Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- List<string> products = new List<string>();
- foreach (var filePath in filePaths)
- {
- try
- {
- var productCollection = DeserializeStore
- (
- filePath => ExtractPath(),
- dataFeed.FeedFormat => TranformFeed(
- filePath,
- parsingModel,
- storeProducts,
- store,
- products
- ),
- parsingModel => ExtractParsingModel(
- store,
- dataDeed.Feed
- ),
- store1 => ImportProducts
- (
- store1.ProductsCollection.Products,
- productDb => GetProductDb(
- dataFeed.Store,
- dbCtx
- ),
- dbCtx, // dbContext
- log => GetLogger(
- store1,
- dbCtx
- ),
- dataFeed.DeleteProductsNotInFeed,
- dataFeed.DeleteRule
- )
- );
- products.AddRange(
- productCollection
- );
- }
- catch (Exception ex)
- {
- throw ex;
- }
- finally
- {
- if (dataFeed.FeedFormat != FeedFormat.Jeeeome)
- {
- _logger.LogInformation($"Deleting temp file: {filePath}");
- File.Delete(filePath);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement