Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var qry = _productRepository.Table.GroupJoin(_categoriesRepository.Table,
- p => p.CategoryId,
- c => c.Id,
- (p, c) => new { Product = p, Categories = c.DefaultIfEmpty() })
- .Where(hdg => hdg.Product.Hidden == false)
- .SelectMany(final => final.Categories,
- (final, c) => new CatalogItemResponse
- {
- ChildrenCategoryId = final.Product.ChildrenCategoryId,
- //DistributionCenterErpId = final.Product.DistributionCenterErpId,
- //Atribuições
- .......
- }).ToList();
- qry.ForEach(q =>
- {
- var product = new Product();
- product.CategoryId = q.CategoryId;
- product.AuthorizeMaximumPercentageAlteration = q.AuthorizeMaximumPercentageAlteration;
- product.AuthorizeMinimumPercentageAlteration = q.AuthorizeMinimumPercentageAlteration;
- product.HaveMaximumPercentage = q.HaveMaximumPercentage;
- product.HaveMinimumPercentage = q.HaveMinimumPercentage;
- product.Hidden = q.Hidden;
- product.ChildrenCategoryId = q.ChildrenCategoryId;
- product.Description = q.Description;
- //product.DistributionCenterErpId = q.DistributionCenterErpId;
- //Mais atribuições e etc
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement