I’m using the Entity framework 3.5 and am having trouble running this query.
I have the following entities: Applicant, application, and applicationstatusHistory (tracking job applicants)
I’m looking for matches in Application where there are no matching applicationids in applicationstatusHistory with an id of -insert param here-. The 2 entities are joined by applicationid.
Here’s my current statement:
applications = context.Application.Include("Applicant").Include("ApplicationStatusHistory")
.Where(LinqExtension.BuildContainsExpression<Application, int>(a => a.Id, applicationIds))
.ToList();
Not sure what’s going ion in the BuildContainsExpression, but here’s a WhereNotIn method that I found somewhere that I’ve been using:
Edit: As noted in the comments, this code needs to be placed in a static class to be used as an extension method.