Click here to Skip to main content
15,884,472 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
THIS IS my QUERY
C#
Select * from EmployeeStatus es where Not exists 
(select * from RouteSectorStatus rS  WHERE es.Employee_Id=rS.Employee_Id AND RouteSectorStatusDate='2015-05-20')

IF employee that
are already used up can never used up again,rather employee that are
left behind are allocated for next function for the same day.
THIS query is function properly but i want to change that query Using EF OR LINQ
Posted

1 solution

Something like this should work:
C#
var theDate = new DateTime(2015, 5, 20);

var data = context.EmployeeStatuses.Where(
    es => !context.RouteSectorStatuses.Any(
        rs => rs.Employee_Id == es.Employee_Id && rs.RouteSectorStatusDate == theDate));
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900