I have these two classes
public class Person
{
}
public class Company
{
public List<Person> Persons
{get;set;}
}
Challenge: Given a list of Company (i.e., List<Company> Companies
). Create a dictionary
with the key Person
, and a list of Company
he belongs to as the values. Note that one Person
can belong to multiple Companies
.
I am only interested in LINQ solution; a brute force search and collect is not what I want.