I have a question about IGrouping
and the Select()
method.
Let's say I've got an IEnumerable<IGrouping<int, smth>>
in this way:
var groups = list.GroupBy(x => x.ID);
where list
is a List<smth>
.
And now I need to pass values of each IGrouping
to another list in some way:
foreach (var v in structure)
{
v.ListOfSmth = groups.Select(...); // <- ???
}
Can anybody suggest how to get the values (List<smth>
) from an IGrouping<int, smth>
in such a context?
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…