protected override void Process() { StockAndPriceDiffComparisonHelper productComparionHelper = null; foreach (var language in Languages) { CurrentLanguage = language; var Soap = new AssortmentService(); Logger.Info("Processing language " + language.Language.Name); using (Service service = new Service(Connector.ConnectorID)) { Assortment = service.GetStockAndPrices(); } Logger.Info(string.Format("Loaded {0} records from service for connector {1}", Assortment.Count, Connector.Name)); var serializationPath = Path.Combine(_serializationPath, Connector.ConnectorID.ToString(), language.LanguageID.ToString()); if (!Directory.Exists(serializationPath)) { Directory.CreateDirectory(serializationPath); } productComparionHelper = new StockAndPriceDiffComparisonHelper(Assortment, serializationPath); Assortment = productComparionHelper.ProductsToProcess; AssortmentToDeactivate = productComparionHelper.ProductsToDelete; Logger.Info("Performed delta"); UsesConfigurableProducts = (from p in Assortment where (p.IsConfigurable) select p ).Any(); var ProductList = Assortment.ToDictionary(x => x.ProductID, z => z); if (UsesConfigurableProducts) { var rpc = Assortment.Where(c => c.IsConfigurable).ToList(); ConfigurableProducts = (from p in Assortment where p.IsConfigurable && p.RelatedProducts != null let children = (from rp in p.RelatedProducts let relatedProductId = rp.RelatedProductID where rp.IsConfigured && ProductList.ContainsKey(relatedProductId) select ProductList[relatedProductId]).ToList() where children.Count() > 0 select new { Parent = p, Children = children }).ToDictionary(x => x.Parent.ProductID, y => y.Children.ToList()); SimpleProducts = new HashSet <int>((from p in ConfigurableProducts select p.Value.Select(x => x.ProductID) ).SelectMany(x => x).Distinct()); } Logger.Info("Processing stock for " + language.Language.Name); SyncProducts(); productComparionHelper.ArchiveExportedAssortment(); } }