I have this structure
Customer - has many Orders - has many OrderItems
I want to generate a list of CustomerItems via LINQ give
CustomerItems
you may also like this
var Grp = Model.GroupBy(item => item.Order.Customer) .Select(group => new { Customer = Model.First().Customer, CustomerId= group.Key, Orders= group.ToList() }) .ToList();