LINQ Inner Join

In LINQ, Inner join is used to return only the matched records or elements from the collections based on the specified conditions.

Syntax of LINQ Inner Join

Here is the syntax of using the LINQ Inner join to get the elements from the collections based on the specified condition.

From the above syntax, we are trying to get the elements from "objEmp", "objDept" collections based on the matching "DeptId" column values.

Example of LINQ Inner Join

Here is the example of using the LINQ Inner join to get the elements from the collection based on the specified conditions.

C# Code

Output:

LINQ Inner Join

From the above example, we are getting the employee name and department name from both the collections where we mapped employees with the department.


Next TopicLINQ Left Join




Latest Courses