public static List<IClient> GetActiveClients() { var aimServiceConfiguration = System.Configuration.ConfigurationManager.GetSection("aimServiceConfigurationGroup/aimServiceConfiguration") as AIMServiceConfigurationSection; List<IClient> result = null; using (DomainContext ctx = new DomainContext()) { Manager mgr = new Manager(ctx); ClientManager cmgr = new ClientManager(mgr); if(aimServiceConfiguration.ServiceConfiguration.TestClientId != Guid.Empty) result = cmgr.GetActive().Where(n => n.ImportType.TypeName == IMPORT_TYPE && n.Id == aimServiceConfiguration.ServiceConfiguration.TestClientId).OfType<IClient>().ToList(); else result = cmgr.GetActive().Where(n => n.ImportType.TypeName == IMPORT_TYPE).OfType<IClient>().ToList(); } return result.ToList(); }
public static List<IClient> GetActiveClients() { var aimServiceConfiguration = System.Configuration.ConfigurationManager.GetSection("aimServiceConfigurationGroup/aimServiceConfiguration") as AIMServiceConfigurationSection; List<IClient> result = new List<IClient>(); using (DomainContext ctx = new DomainContext()) { Manager mgr = new Manager(ctx); ClientManager clientManager = new ClientManager(mgr); if (aimServiceConfiguration.ServiceConfiguration.TestClientId != Guid.Empty) result = clientManager.GetActive() .Where(x => x.Id == aimServiceConfiguration.ServiceConfiguration.TestClientId) .ToList(); else result = clientManager.GetActive().ToList(); } return result; }