public OrderService(OrdersBDContext context, IProductService productService, IClientService clientService, IManagerService managerService) { _context = context; _productService = productService; _clientService = clientService; _managerService = managerService; }
protected override async Task ExecuteAsync(CancellationToken stoppingToken) { try { string path = ConfigurationManager.AppSettings["SaleInfoDirPath"]; OrdersBDContext ordersBdContext = new OrdersBDContext("SalesDB"); using (FileWatcher fileWatcher = new FileWatcher(new CsvFileReader <SalesInfoMap, SalesInfo>(), path, new SaleInfoProcessor(new OrderService(ordersBdContext, new ProductService(ordersBdContext), new ClientService(ordersBdContext), new ManagerService(ordersBdContext))))) fileWatcher.StartWatching(); } catch (Exception e) { _logger.LogError(e, " error "); } }
static void Main(string[] args) { try { string path = ConfigurationManager.AppSettings["SaleInfoDirPath"]; OrdersBDContext ordersBdContext = new OrdersBDContext("SalesDB"); using (FileWatcher fileWatcher = new FileWatcher(new CsvFileReader <SalesInfoMap, SalesInfo>(), path, new SaleInfoProcessor(new OrderService(ordersBdContext, new ProductService(ordersBdContext), new ClientService(ordersBdContext), new ManagerService(ordersBdContext))))) { fileWatcher.StartWatching(); Thread.Sleep(5000); fileWatcher.StopWatching(); } } catch (Exception e) { Console.WriteLine(e); } }
public ManagerService(OrdersBDContext context) { _context = context; }
public ClientService(OrdersBDContext context) { _context = context; }
public ProductService(OrdersBDContext context) { _context = context; }