using (RapidWorkflowDataContext context = new RapidWorkflowDataContext())
{
var query = from w in context.WorkflowInstances
from c in context.Workflows
where EmpWorkflowIDs.Contains((int)w.ID) && w.CurrentStateID != c.LastStateID
select w;
return query.ToList();
}
I have 2 tables: Workflows and WorkflowInstances.
Workflows to store objects and workflowInstances to store instances.
Workflows Table: ID,Name,FirstStateID,LastStateID
WorkflowInstances Table: ID,Name,WorkflowID,CurrentStateID
How to write a query in linq to sql to select the instances from WorkflowInstances which CurrentStateID not equal LastStateID
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…