I refer to examples in How to combine data with Linq using joins . We have two lists in which human objects are stored (first and last name). The second list contains Pet (Name) objects that contain the face object (pet owner). One person can own> = 0 pets.
What happened now, I made a group connection
Dim result1 = From pers in people Group Join pet in pets on pers Equals pet.Owner Into PetList = Group
LinqPad shows me the result:

It seems to me that Linq makes a lot of layoffs (but I could be wrong here!). The first result object will hold the human object three times. Here for me there are two questions like Linq nooby (but maybe I am reading the result wrong):
- Are object object references? Unfortunately, I could not find anything.
- Following the above example, the query continues with
Select pers.FirstName , pers.LastName, PetName = If(pet is Nothing, String.Empty, pet.Name)
If we have all the information about the Person object in PetList, why not just request this object? In my opinion, we no longer need pers Object.
source share