public AdminController( [CreateNew] IUnitOfWork unitOfWork, [ServiceDependency] ILcboProductsService lcboProductsService, [ServiceDependency] ILcboStoresService lcboStoresService, [CreateNew] IFastDomainContext domainContext ) { this.unitOfWork = unitOfWork; this.logWriter = EnterpriseLibraryContainer.Current.GetInstance<LogWriter>(); this.traceManager = new TraceManager(this.logWriter); this.lcboProductsService = lcboProductsService; this.lcboStoresService = lcboStoresService; this.domainContext = domainContext; }
static void Main(string[] args) { //lcboProductsService = new LcboProductServiceAgent(new TestPageRetrieverFactory()); lcboProductsService = new LcboProductServiceAgent(new LivePageRetrieverFactory()); Stopwatch getProductsStopwatch = new Stopwatch(); getProductsStopwatch.Start(); unitOfWork = new SqlUnitOfWork(); var lcboProducts = lcboProductsService.GetAllProducts(); var substanceDict = BuildSubstanceDictionaryAndUpdateDbIfNeeded(lcboProducts); var containerDict = BuildContainerDictionaryAndUpdateDbIfNeeded(lcboProducts); UpdateProductsInDb(lcboProducts, substanceDict, containerDict); getProductsStopwatch.Stop(); Console.WriteLine(String.Format("Elapsed time in seconds: {0:0.00}", getProductsStopwatch.ElapsedMilliseconds / 1000.00)); }