I am currently struggling to assemble a LINQ query on my objects collections : Persons, Cars
Each person can have multiple cars.
I want to select all PERSONS in persons and all group all cars owned by this person. The query I have written so far is:
from c in persons,d in cars
where c.id = d.ownerID
group by c.Firstname into MG = tolist()
but it only returns persons who have cars. If a person does not have car, he is not in list. I cannot make up with the right logic.
try:
and classes are :