public DataProviderController(
            ICountryNamesProvider countryNamesProvider,
            IFlatProductsProvider flatProductsProvider,
            IProductCategoriesProvider productCategoriesProvider,
            IProductsProvider productsProvider,
            ISalesInfoDataProvider salesInfoDataProvider,
            ISalesViewerDataProvider salesViewerDataProvider
            )
        {
            var ct = _cancellationToken = _cts.Token;

            InitializeEntities(countryNamesProvider, countryNamesProvider.LoadAsync, ct);
            InitializeEntities(flatProductsProvider, flatProductsProvider.LoadAsync, ct);
            InitializeEntities(productCategoriesProvider, productCategoriesProvider.GetProductCategoriesAsync, ct);
            InitializeEntities(productsProvider, productsProvider.LoadAsync, ct);
            InitializeEntities(salesInfoDataProvider, salesInfoDataProvider.GetSalesAsync, ct);

            InitializeEntities(salesViewerDataProvider, salesViewerDataProvider.GetChannels, ct);
            InitializeEntities(salesViewerDataProvider, salesViewerDataProvider.GetCities, ct);
            InitializeEntities(salesViewerDataProvider, salesViewerDataProvider.GetContacts, ct);
            InitializeEntities(salesViewerDataProvider, salesViewerDataProvider.GetCustomers, ct);
            InitializeEntities(salesViewerDataProvider, salesViewerDataProvider.GetPlants, ct);
            InitializeEntities(salesViewerDataProvider, salesViewerDataProvider.GetProducts, ct);
            InitializeEntities(salesViewerDataProvider, salesViewerDataProvider.GetRegions, ct);
            InitializeEntities(salesViewerDataProvider, salesViewerDataProvider.GetSales, ct);
            InitializeEntities(salesViewerDataProvider, salesViewerDataProvider.GetSectors, ct);

            _providersReadyToTransfer = Task.WhenAll(_lookup.Values);
        }
Example #2
0
 public FlatProductService(IFlatProductsProvider provider)
 {
     _provider = provider;
 }