using System.Collections.Generic;
public static void Main()
var empInfo = (from emp in Employees
on new {emp.FirstName,emp.LastName} equals new {dep.FirstName,dep.LastName}
where emp.Location == "Hyderabad" && dep.DepartmentName == "DotNet"
foreach(var item in empInfo)
public static List<Employee> Employees
return new List<Employee>()
new Employee() { FirstName = "Anil", LastName = "Vemula", Location = "Hyderabad"},
new Employee() { FirstName = "Kedarnath", LastName = "Kulakarni", Location = "Banglore"},
new Employee() { FirstName = "Prasad", LastName = "Aripaka", Location = "Hyderabad"}
public static List<Department> Departments
return new List<Department>()
new Department() { FirstName = "Anil", LastName = "Vemula", DepartmentName = "DBA"},
new Department() { FirstName = "Kedarnath", LastName = "Kulakarni", DepartmentName = "DotNet"},
new Department() { FirstName = "Prasad", LastName = "Aripaka", DepartmentName = "DotNet"}
public string FirstName { get; set; }
public string LastName {get; set; }
public string Location { get; set; }
public string FirstName { get; set; }
public string LastName {get; set; }
public string DepartmentName { get; set; }