Answers for "right outer join in linq sql"

SQL
0

right outer join in linq sql

using (JoinEntities Context = new JoinEntities())  
{  
    var rightOuterJoin = from d in Context.DepartmentMasters  
    join e in Context.EmployeeMasters on d.DepartmentId equals e.DepartmentId into emp  
    from employee in emp.DefaultIfEmpty()  
    select new  
    {  
        EmployeeCode = employee.Code,  
        EmployeeName = employee.Name,  
        DepartmentName = d.Name  
    };  
    Console.WriteLine("Employee Code\tEmployee Name\tDepartment Name");  
    foreach (var data in rightOuterJoin)  
    {  
        Console.WriteLine(data.EmployeeCode + "\t\t" + data.EmployeeName + "\t" + data.DepartmentName);  
    }  
}
Posted by: Guest on September-07-2021

Code answers related to "right outer join in linq sql"

Code answers related to "SQL"

Browse Popular Code Answers by Language