What is Join() in LINQ?

Medium2-4 Years

Join()

Join() combines two collections using a common key.

Example

var result =
employees.Join(
departments,
e => e.DepartmentId,
d => d.Id,
(e,d)=> new
{
e.Name,
d.DepartmentName
});

Interview Tips

Join is similar to SQL INNER JOIN.