My project uses Entity Framework Core as ORM. Lazy loading is enabled by default:
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
optionsBuilder.UseLazyLoadingProxies();
}
I need to write a code, which processes some big collection of objects with navigation properties. To decrease amount of database requests, I would like to download the objects with their navigation properties "eagerly".
What is right way to do this? Can I just use something like this:
dbContext.MyObjects.Include(myObject => myObject.NavigationProperty).ToListAsync()