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 data that is in the form
Data.Period = x
Data.Adjustment = y
I perform a GroupBy
var groupedData = Data.GroupBy(x => x.Period new {x.Period});
This brings back (according to linq) my hierarchical data which is starting to look how I want it. Id like to iterate through the contents but cant…How do I do this? and how do I…
Work how to get to the Data.Adjustment without using a projection. And I dont want to project yet because I have to perform another grouping….help! 🙂
The
IGrouping<TKey, TElement>interface inheritsIEnumerable<TElement>:I note that you will be better off using this for your query, however:
rather than this:
If, for example, you wanted to average the adjustments, you could do this: