public DataProviderController(
            IProductsFlatProvider productsFlatProvider,
            IProductCategoriesProvider productCategoriesProvider,
            ISalesInfoDataProvider salesInfoDataProvider,
            INwindDataProvider nwindDataProvider,
            IIssuesDataProvider issuesDataProvider,
            IWorldcitiesDataProvider worldcitiesDataProvider
            )
        {
            var ct = _cancellationToken = _cts.Token;

            InitializeEntities(productsFlatProvider, productsFlatProvider.GetProductsAsync, ct);
            InitializeEntities(productCategoriesProvider, productCategoriesProvider.GetProductCategoriesAsync, ct);

            InitializeEntities(salesInfoDataProvider, salesInfoDataProvider.GetSalesAsync, ct);

            InitializeEntities(nwindDataProvider, nwindDataProvider.GetCategoriesAsync, ct);
            InitializeEntities(nwindDataProvider, nwindDataProvider.GetCustomersAsync, ct);
            InitializeEntities(nwindDataProvider, nwindDataProvider.GetEmployeesAsync, ct);
            InitializeEntities(nwindDataProvider, nwindDataProvider.GetInvoicesAsync, ct);
            InitializeEntities(nwindDataProvider, nwindDataProvider.GetOrdersAsync, ct);
            InitializeEntities(nwindDataProvider, nwindDataProvider.GetOrderDetailsAsync, ct);
            InitializeEntities(nwindDataProvider, nwindDataProvider.GetProductsAsync, ct);
            InitializeEntities(nwindDataProvider, nwindDataProvider.GetShippersAsync, ct);
            InitializeEntities(nwindDataProvider, nwindDataProvider.GetSuppliersAsync, ct);

            InitializeEntities(issuesDataProvider, issuesDataProvider.GetItemsAsync, ct);
            InitializeEntities(issuesDataProvider, issuesDataProvider.GetProjectsAsync, ct);
            InitializeEntities(issuesDataProvider, issuesDataProvider.GetUsersAsync, ct);

            InitializeEntities(worldcitiesDataProvider, worldcitiesDataProvider.GetCountriesAsync, ct);
            InitializeEntities(worldcitiesDataProvider, worldcitiesDataProvider.GetCitiesAsync, ct);

            _providersReadyToTransfer = Task.WhenAll(_lookup.Values);
        }
Пример #2
0
 public IssuesDataService(IIssuesDataProvider dataProvider)
 {
     _dataProvider = dataProvider;
 }