c# - Group a set of rows based on a column -
hi have case getting data from database , looks this:

i using entity framework database first , stored procedure data.this model back:
public partial class getelearningsessionsforstudent_result { public int lessonnumber { get; set; } public string lessontitle { get; set; } public nullable<int> status { get; set; } public nullable<system.datetime> targetdate { get; set; } public string eventtitle { get; set; } } now able group lessonnumber , use key , contain following:
key data {lessonnumber , lessontitle} {status , targetdate , eventtitle} i have been trying hours , feels somehoe missing something. how can achieve this?
is you're looking for?
listofitems.groupby(key => new { key.lessonnumber, key.lessontitle }, data => new {data.status, data.targetdate, data.eventtitle});
Comments
Post a Comment