Querry Lazy Loading in EF Code First

Asked

Viewed 43 times

2

It is possible to create a querry Lazy loading using a DbContext What is Eager Loading doing? Is there any way I can specify that

Company company = db.Comanies.Find(id);

this command does not need to bring related entities with it?

  • What is your EF version?

  • 1

    @Virgilionovic got the 6

1 answer

3


To disable in query specifies do so:

db.Configuration.LazyLoadingEnabled = false;
Company company = db.Comanies.Find(id);
  • It makes sense, then I experiment to see if I accept the answer ;)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.