Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/08/09 12:42:03 (15 years ago)
Author:
svonolfe
Message:

Small refactoring of the manyToManyRelationHelper (#527)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.DataAccess.ADOHelper/3.2/ManyToManyRelationHelper.cs

    r1729 r1758  
    1010    {
    1111    ITableAdapterWrapper<AdapterT, ManyToManyRelation, RowT> tableAdapterWrapper;
    12    
     12
     13    private int childIndex;
     14
    1315    public ManyToManyRelationHelper(
    14       ITableAdapterWrapper<AdapterT, ManyToManyRelation, RowT> tableAdapterWrapper) {
     16      ITableAdapterWrapper<AdapterT, ManyToManyRelation, RowT> tableAdapterWrapper,
     17      int childIndex) {
    1518      this.tableAdapterWrapper = tableAdapterWrapper;
     19      this.childIndex = childIndex;
    1620    }
    1721
     
    2428    public void UpdateRelationships(Guid objectA,
    2529      IList<Guid> relationships, int childIndex) {
    26       UpdateRelationships(objectA, relationships, null, childIndex);
     30      UpdateRelationships(objectA, relationships, null);
    2731    }
    2832
    2933    public void UpdateRelationships(Guid objectA,
    3034      IList<Guid> relationships,
    31       IList<object> additionalAttributes, int childIndex) {
     35      IList<object> additionalAttributes) {
    3236      //firstly check for created references
    3337      IList<Guid> existing =
    34         this.GetRelationships(objectA, childIndex);
     38        this.GetRelationships(objectA);
    3539
    3640      foreach (Guid relationship in relationships) {
     
    6367      foreach (Guid relationship in deleted) {
    6468        RowT toDelete =
    65           FindRow(objectA, relationship, childIndex);
     69          FindRow(objectA, relationship);
    6670        if (toDelete != null) {
    6771          toDelete.Delete();
     
    7175    }
    7276
    73     public IList<Guid> GetRelationships(Guid objectA, int childIndex) {
     77    public IList<Guid> GetRelationships(Guid objectA) {
    7478      IList<Guid> result =
    7579        new List<Guid>();
     
    8589    }
    8690
    87     private RowT FindRow(Guid objectA, Guid objectB, int childIndex) {
     91    private RowT FindRow(Guid objectA, Guid objectB) {
    8892      IEnumerable<RowT> rows =
    8993       tableAdapterWrapper.FindById(objectA);
Note: See TracChangeset for help on using the changeset viewer.