I have two tables in sql db server,name as EmployeeDuty and EmployeeStatus where
multiple records of same employees are exist,i used following queries to get last record against each employee.
1.var Empdutyleft = _service.GetAllEmployeeDuty().OrderByDescending(x => x.EndDate)
.GroupBy(x => x.Employee_Id).Select(x => x.First()).Where(x => x.ToSector_Id == sectorId).ToList();
2. var EmpStatus = _service.GetEmployeeStatusBySector_Id(sectorId).OrderByDescending(x => x.EndDate)
.GroupBy(x => x.Employee_Id).Select(x => x.First()).ToList();
i want to get that employee that exist in EmployeeDuty but not exist in EmployeeStatus