C# program to join Employee and Department class using Linq Join Query
All Answers
total answers (1)
Severity: 8192
Message: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated
Filename: libraries/Filtered_db.php
Line Number: 23
total answers (1)
Program:
The source code to join Employee and Department using Linq Join Query, which is given below. The given program is compiled and executed successfully on Microsoft Visual Studio.
Output:
Explanation:
In the above program, we created three classes Employee, Department, and JoinDemo. Employee class contains data members ID, Name, Salary, and DEPT_ID. The Department class contains DEPT_ID and DEPT_Name.
Now look to the JoinDemo class, the JoinDemo class contains the Main() method. In the Main() method we created a list of employees and departments.
In the above code we joined Employee and Department class using join query and select ID, Name, Salary, and DEPT_Name.
The above code will print the result of join on the console screen.
need an explanation for this answer? contact us directly to get an explanation for this answer