Hi there!
I just got Entity Framework 4.1 and updated my model to use it. The thing is that the code that was working ok is not now.
public static IEnumerable<Employee> GetEmployees()
{
IntranetModelContainer db = new IntranetModelContainer();
return db.Entities.OfType<Employee>();
}
When I try to call that method, I get this exception:
Data binding directly to a store query (DbSet, DbQuery, DbSqlQuery) is not supported. Instead populate a DbSet with data, for example by calling Load on the DbSet, and then bind to local data. For WPF bind to DbSet.Local. For WinForms bind to DbSet.Local.ToBindingList().
I've searched and found this http://social.msdn.microsoft.com/Forums/en-NZ/adodotnetentityframework/thread/65e5ed34-751e-4bd9-90a0-ae83ac81ba6c guy with the same problem. I try to use his solution, but I did not have a Load method to call anywhere.
Well, how do I bind a DataGrid to a EntityFramework object now?
Thanks