using (RapidWorkflowDataContext context = new RapidWorkflowDataContext())
{
var query = from w in context.WorkflowInstanc
You can eliminate join and it should be something like:
var query = from w in context.WorkflowInstances
where !context.Workflows.Any(c => w.CurrentStateID != c.LastStateID) && EmpWorkflowIDs.Contains((int)w.ID)
select w;
You need to revise the join to be on the related columns between the 2 tables, then you add your condition in the where clause, like the following:
using (RapidWorkflowDataContext context = new RapidWorkflowDataContext())
{
var query = from w in context.WorkflowInstances
join c in context.Workflows on w.WorkflowID equals c.ID
where EmpWorkflowIDs.Contains((int)w.ID)
&& w.CurrentStateID != c.LastStateID
select w;
return query.ToList();
}
If you are using lambda expressions, then not(!) goes there:
.Where(p => !p.Whatever...)