I have a list of products with productname, productprice & category. I want to write a linq query to group all the products according to category. I have tried the following:
var p = from s in productlist
group s by s.Category into g
select new { Category = g.Key, Products = g};
With this query, it's showing a table with two column as category & product. Category column has two categories as expected but under products column, there is no data. I would love to have all the product list separated by the category.