partition a list of products by category.

Saratvaddilli
Posted by Saratvaddilli under LINQ category on | Points: 40 | Views : 900
public void LinqExample()
{
List<Product> products = GetProductList();

var orderGroups =
from p in products
group p by p.Category into g
select new { Category = g.Key, Products = g };

ObjectDumper.Write(orderGroups, 1);
}

Comments or Responses

Login to post response