My class:
public class Foo
{
public int A { get; set; }
public List<Bar> Bars { get; set; }
}
I've got IEnumerable<Foo>. I would like get List<Foo> grouping by A, and get Bars list, which contais all elements at Bars for group.
So final Foo.Bars should contains all elements of Bar at group
Is it possible with linq?
Foosin your sourceIEnumerable<Foo>already that way? You source must be of a different type, right? What does the source actually look like?