Search code examples
c#linqigrouping

How to get values out of IGrouping?


I have applied IGrouping<> over a list - here's what it looks like:

IEnumerable<IGrouping<TierRequest,PingtreeNode>> Tiers
{
    get { return ActiveNodes.GroupBy(x => new TierRequest(x.TierID, x.TierTimeout, x.TierMaxRequests)); }
}

Later in my code I iterate over Tiers. Its simple to get the key data using the Key element, but how do I get the IEnumerable<PingtreeNode> that forms the value part?

Thanks in advance


Solution

  • Tiers.Select(group => group.Select(element => ...));