Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

entity framework 4: where is my load method and IsLoaded property?

I am using EF4, and I using the System.Data.Entity dll in my class. However, I can't see the load method of my navigation property of my entity.

How can I access to this method?

What I am doing is create e 4.0 project of .NET, create my edmx from a database, right click in the model edmx and I generate a DBContext.

However, I can access to the local property of my context, that I think that is a feature of EF4.

Thanks. Daimroc.

like image 584
Álvaro García Avatar asked Dec 16 '25 23:12

Álvaro García


1 Answers

For the DbContext approach, the IsLoaded property and Load method have been moved:

context.Entry(yourEntity)
   .Collection(entity => entity.NavigationProperty)
   .IsLoaded;

context.Entry(yourEntity)
   .Collection(entity => entity.NavigationProperty)
   .Load();
  • Entry method: http://msdn.microsoft.com/en-us/library/gg696578(v=vs.103).aspx
  • Collection method: http://msdn.microsoft.com/en-us/library/gg671324(v=vs.103).aspx
  • IsLoaded property: http://msdn.microsoft.com/en-us/library/gg696146(v=vs.103).aspx
  • Load method: http://msdn.microsoft.com/en-us/library/gg696220(v=vs.103).aspx
like image 58
Richard Deeming Avatar answered Dec 19 '25 11:12

Richard Deeming