How to join collections with LINQ in C#
The LINQ Join() method combines two sequences on a matching key, equivalent to a SQL inner join. Elements from both sides that share the same key are combined into a result; elements with no match are excluded.
For left-join behavior (keep all elements from the left, even without a match), use GroupJoin(). To combine every combination of two sequences, use SelectMany() as a cross join.
On this page
Basic Inner Join
Join: Method Syntax vs Query Syntax
GroupJoin: Simulating a Left Join
GroupJoin() keeps all elements from the left (outer) sequence and groups matching elements from the right (inner) sequence. Combined with SelectMany() and DefaultIfEmpty(), it produces a left join.
Join on Multiple Keys
Cross Join with SelectMany
A cross join returns every combination of two sequences. There's no dedicated LINQ method; use nested SelectMany() instead.
Real-World Example: Orders with Customer Details and Products
Join Types: Quick Comparison
| Join Type | LINQ Method | SQL Equivalent | Excludes non-matches? |
|---|---|---|---|
| Inner join | Join() | INNER JOIN | Yes (both sides must match) |
| Left join | GroupJoin() + SelectMany() + DefaultIfEmpty() | LEFT JOIN | No (left side always included) |
| Cross join | SelectMany() | CROSS JOIN | N/A (all combinations) |
| Group join | GroupJoin() | — | No (groups inner into a list) |
Take It Further

The most comprehensive book covering C# 12 and .NET 8 from scratch to production.
C# 12 and .NET 8: Modern Cross-Platform Development · Mark J. Price
Get it on Amazon →As an Amazon Associate I earn from qualifying purchases.
Related Articles
Filter a collection in C# with LINQ Where() by passing a predicate function. Uses deferred execution and returns only elements satisfying the condition.
Use LINQ Select() in C# to project each element into a new form. Transforms a collection with a lambda and returns a new IEnumerable with the results.
Use LINQ GroupBy() in C# to group elements by a key selector. Returns groups each containing the key and matching elements from the source collection.