I upgraded my entity framework 4.3 database first project to the new entity framework 5.
Apparently I'm now using DbContext instead of ObjectContext.
I've replaced my old .edmx file with a new one. My old business code, that was previously using my 4.3 .edmx file, now has a problem with code using the LoadProperty
method:
using (var context = new MyEntities())
{
Models.User user = context.Users.First(x => x.GUID == guid);
context.LoadProperty(user, o => o.Settings);
return user;
}
It seems that LoadProperty is not an available method in DbContext.
How can I can get strong typed loading anyway?
I suppose I could use
context.Users.Include("Settings")
but that is not strong typed and prone to typos.