Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- return await context.Products.Select(p => new ProductListModel
- {
- Id = p.Id,
- Name = p.Name,
- Price = p.Price,
- Description = p.Description,
- PictureUrl = p.PictureUrl,
- Categories = p.ProductCategories.Select(pc => new CategoryListModel
- {
- Id = pc.Category.Id,
- Name = pc.Category.Name
- })
- }).ToListAsnyc();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement