I have the following LINQ example:
var colorDistribution =
from product in ctx.Products
group product by product.Color
into productColors
select
new
{
Color = productColors.Key,
Count = productColors.Count()
};
It all works and makes sense.
What I'm trying to achieve is to group a syntax type instead of an anonymous type.
For example, I have a ProductColour class, and I would like to Group in List<ProductColour>
Is it possible?
thank
user338195
source
share