I am using EF4 within a MVC3 application and I was looking for a way to view all my contacts within a given workgroup. In the controller I specified:
var wg = from w in _repo.Workgroups.Include("Contact").ToList();
but I get the following error:
'System.Linq.IQueryable' does not contain a definition for 'Include' and no extension method 'Include' accepting a first argument of type 'System.Linq.IQueryable' could be found (are you missing a using directive or an assembly reference?)
I though this method was built into EF4. Do I have enable it somehow?
I was also getting this error and resolved it by adding the following reference:
using System.Data.Entity;