Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/17/09 14:03:06 (15 years ago)
Author:
svonolfe
Message:

Refactored ResourceAdapter (polymorphic implementation) (#372)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/3.2/ClientGroupAdapter.cs

    r1580 r1597  
    7171      }
    7272    }
    73 
    74     private IClientAdapter clientAdapter = null;
    75 
    76     private IClientAdapter ClientAdapter {
    77       get {
    78         if (clientAdapter == null)
    79           clientAdapter =
    80             this.Session.GetDataAdapter<ClientInfo, IClientAdapter>();
    81 
    82         return clientAdapter;
    83       }
    84     }
    8573    #endregion
    8674
     
    10290       clientGroup.Resources.Clear();
    10391        foreach(Guid resource in resources) {
    104           ClientInfo client =
    105             ClientAdapter.GetById(resource);
     92          Resource res =
     93            ResAdapter.GetByIdPolymorphic(resource);
    10694
    107           if (client == null) {
    108             //client group
    109             ClientGroup group =
    110               GetById(resource);
    111 
    112             clientGroup.Resources.Add(group);
    113           } else {
    114             clientGroup.Resources.Add(client);
    115           }         
     95            clientGroup.Resources.Add(res);         
    11696        }
    11797
     
    141121          new List<Guid>();
    142122        foreach(Resource res in group.Resources) {
    143           if (res is ClientInfo) {
    144             ClientAdapter.Update(res as ClientInfo);
    145           } else if (res is ClientGroup) {
    146             Update(res as ClientGroup);
    147           } else {
    148             ResAdapter.Update(res);
    149           }
     123          ResAdapter.UpdatePolymorphic(res);
    150124
    151125          relationships.Add(res.Id);
Note: See TracChangeset for help on using the changeset viewer.