I have two classes:
class Foo
{
public Bar SomeBar { get; set; }
}
class Bar
{
public string Name { get; set; }
}
I have a list of Foos that I group together:
var someGroup = from f in fooList
orderby f.SomeBar.Name ascending
group f by f.SomeBar.Name into Group
select Group;
How can I get the list of the distinct Bars from someGroup?