SHARE
TWEET

Untitled

a guest Feb 18th, 2020 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. return await context.Products.Select(p => new ProductListModel
  2. {
  3.     Id = p.Id,
  4.     Name = p.Name,
  5.     Price = p.Price,
  6.     Description = p.Description,
  7.     PictureUrl = p.PictureUrl,
  8.     Categories =  p.ProductCategories.Select(pc => new CategoryListModel
  9.                 {
  10.                     Id = pc.Category.Id,
  11.                     Name = pc.Category.Name
  12.                 })
  13. }).ToListAsnyc();
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