using System.Collections.Generic;
public static void Main()
var empDetails = Employee.GetEmployees().Join(Department.GetDepartment(),
d => d.DepartmentId, (employee, department) => new { Employee = employee, Department = department }).
foreach (var item in empDetails)
Console.WriteLine(item.Employee.FullNAme + "\n" + item.Department.DepartmentName + "\n");
public int EmpId {get;set;}
public string FullNAme {get;set;}
public int RoleId { get;set;}
public int DepartmentId {get;set;}
public static List<Employee> GetEmployees()
return new List<Employee>()
new Employee {EmpId = 1,FullNAme = "Givi Roinishvili",RoleId = 1,DepartmentId = 1},
new Employee {EmpId = 1,FullNAme = "Giorgi Varadashvili",RoleId = 1,DepartmentId = 1},
new Employee {EmpId = 1,FullNAme = "Jemal Gvinadze",RoleId = 2,DepartmentId = 2},
public int RoleId {get;set;}
public string RoleName {get;set;}
public static List<Role> GetRoles()
new Role {RoleId = 1,RoleName = "Program Admin"},
new Role {RoleId = 2,RoleName = "Program User"}
public int DepartmentId {get;set;}
public string DepartmentName {get;set;}
public static List<Department> GetDepartment()
return new List<Department>()
new Department {DepartmentId = 1,DepartmentName = "IT Department"},
new Department {DepartmentId = 2,DepartmentName = "Programers Unit"}