daily pastebin goal
11%
SHARE
TWEET

Untitled

a guest Mar 20th, 2019 51 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var qry = _productRepository.Table.GroupJoin(_categoriesRepository.Table,
  2.             p => p.CategoryId,
  3.             c => c.Id,
  4.             (p, c) => new { Product = p, Categories = c.DefaultIfEmpty() })
  5.             .Where(hdg => hdg.Product.Hidden == false)
  6.  
  7.             .SelectMany(final => final.Categories,
  8.             (final, c) => new CatalogItemResponse
  9.             {
  10.                 ChildrenCategoryId = final.Product.ChildrenCategoryId,
  11.                 //DistributionCenterErpId = final.Product.DistributionCenterErpId,
  12.                 //Atribuições
  13.                 .......
  14.              }).ToList();
  15.      
  16. qry.ForEach(q =>
  17.             {
  18.                 var product = new Product();
  19.  
  20.                 product.CategoryId = q.CategoryId;
  21.                 product.AuthorizeMaximumPercentageAlteration = q.AuthorizeMaximumPercentageAlteration;
  22.                 product.AuthorizeMinimumPercentageAlteration = q.AuthorizeMinimumPercentageAlteration;
  23.                 product.HaveMaximumPercentage = q.HaveMaximumPercentage;
  24.                 product.HaveMinimumPercentage = q.HaveMinimumPercentage;
  25.                 product.Hidden = q.Hidden;
  26.                 product.ChildrenCategoryId = q.ChildrenCategoryId;
  27.                 product.Description = q.Description;
  28.                 //product.DistributionCenterErpId = q.DistributionCenterErpId;
  29.                 //Mais atribuições e etc
  30. });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top