I have a simple entity framework query in an MVC3 app, like so
var instances= db.Instances.Include(c => c.CompanyLead).Include(c => c.SalesLead).Include(c => c.Customer);
return View(instances);
This query works fine and essentially returns all instances. However, I need to filter this query and basically add the phrase:
var instances= db.Instances.Include(c => c.CompanyLead).Include(c => c.SalesLead).Include(c => c.Customer)WHERE InstanceType = x
I don’t want to revert to an ObjectQuery class with a DB Context object. I thought I would be able to alter this query. Am i wrong?
1 Answer