How do I iterate an IGrouping Interface?

前端 未结 5 751
逝去的感伤
逝去的感伤 2020-12-24 00:34

Ive got ths really annoying issue I have grouped a set of data and I cant get to the data within the group. I can get to the key bit not the data..

I have a load of

5条回答
  •  青春惊慌失措
    2020-12-24 01:01

    Though maybe obvious for others one can also use:

    var groups = Data.GroupBy(x => x.Period);
    
    foreach(var group in groups)
    {
       List dataListByPeriod = group.ToList();
       //use this list
    }
    

提交回复
热议问题