public IEnumerable <TInterface> CreateDataProviders(SourceUsageOrder sourceUsageOrder) { DataProvidersConfigurationSection section = DataProvidersConfigurationSection.GetCurrent(); DataProvider[] dbProviders = DataProviderManager.ReadDatabaseDataProviders(); var dataProviders = DataProviderManager.GetDataProviderList(section, dbProviders, typeof(TInterface), sourceUsageOrder) .Select(p => p as TInterface); return(dataProviders); }
public StandardReturType CreateDataProviders(out IEnumerable <ISingleDataProvider <TInputElement, TOutputElement> > dataProviders, SourceUsageOrder sourceUsageOrder) { DataProvidersConfigurationSection section = DataProvidersConfigurationSection.GetCurrent(); DataProvider[] dbProviders = DataProviderManager.ReadDatabaseDataProviders(); dataProviders = DataProviderManager.GetDataProviderList(section, dbProviders, InterfaceType, sourceUsageOrder) .Select(p => p as ISingleDataProvider <TInputElement, TOutputElement>); if (dataProviders.FirstOrDefault() == null) { Local.Admin.AddNewLog(TraceEventType.Warning, BrokerContext.Current.WebMethodMessageName, TextMessages.NoDataProvidersFound, null, null); return(StandardReturType.Create(HttpErrorCode.DATASOURCE_UNAVAILABLE)); } return(StandardReturType.OK()); }