METHOD

Enumerable.RightJoin

Performs a right outer equijoin in .NET 10. Every right item is represented; matching left duplicates multiply rows, and an unmatched left reference is null.

Formal Syntax & Structure

csharp syntaxcsharp
outer.RightJoin(inner, outerKey, innerKey, resultSelector)

Working Example

Example Snippetcsharp
using System;using System.Collections.Generic;using System.Linq;Console.WriteLine(string.Join(",", new[] { "B" }.RightJoin(new[] { "A", "B" }, x => x, y => y, (x, y) => (x ?? "none") + ":" + y))); // none:A,B:B
C# & .NET Reference