Wednesday, October 17, 2012

LINQ group by with multiple columns using lambda


var qry = cust.GroupBy(cm => new { cm.Customer, cm.OrderDate }, 
             (key, group) => new { Key1 = key.Customer, Key2 = key.OrderDate, 
                                   Count = group.Count() });

No comments:

Post a Comment