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.
Join() combines two collections using a common key.
var result =
employees.Join(
departments,
e => e.DepartmentId,
d => d.Id,
(e,d)=> new
{
e.Name,
d.DepartmentName
});
Join is similar to SQL INNER JOIN.