Querry Lazy Loading on EF Code First

2

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

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

Does not this command have to bring the entities related to it?

    
asked by anonymous 11.06.2018 / 17:11

1 answer

3

To disable on query specify do so:

db.Configuration.LazyLoadingEnabled = false;
Company company = db.Comanies.Find(id);
    
11.06.2018 / 18:21