You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Provide Perform inner joins article with method-based syntax examples (#36376)
* Implement method syntax approach for each inner join example
* Invoke the method-syntax methods in Program
* Adjust tests to cover the equality between query and method syntax results
* Add the method-syntax examples to the Inner Joins page
* Correct capitalization of a note for grouped joins
Co-authored-by: Bill Wagner <[email protected]>
* Use 2nd person for advices in Inner joins docs
Co-authored-by: Bill Wagner <[email protected]>
---------
Co-authored-by: Bill Wagner <[email protected]>
Note that the `Person` object whose `LastName` is "Huff" does not appear in the result set because there is no `Pet` object that has `Pet.Owner` equal to that `Person`.
35
39
36
40
## Example - Composite key join
@@ -41,6 +45,10 @@ The following example uses a list of `Employee` objects and a list of `Student`
Any number of join operations can be appended to each other to perform a multiple join. Each `join` clause in C# correlates a specified data source with the results of the previous join.
@@ -53,6 +61,10 @@ The second `join` clause in C# correlates the anonymous types returned by the fi
The equivalent using multiple <xref:System.Linq.Enumerable.Join%2A> method uses the same approach with the anonymous type (in the example below it's named `commonOwner`):
Note that this approach requires chaining the query results with <xref:System.Linq.Enumerable.SelectMany%2A> to create the final list of Owner - Pet relation based on the results of group join. To avoid chaining, the single <xref:System.Linq.Enumerable.Join%2A> method can be used as presented below:
0 commit comments