There is no default configuration for eager loading. You must always define Include
or create some reusable method which will wrap adding include. For example you can place similar method to your context:
public IQueryable<MyEntity> GetMyEntities()
{
return this.MyEntities.Include(e => e.SomeOtherEntities);
}
More Related Contents:
- Code-first vs Model/Database-first [closed]
- The relationship could not be changed because one or more of the foreign-key properties is non-nullable
- Should I enable or disable dynamic proxies with entity framework 4.1 and MVC3?
- How do I detach objects in Entity Framework Code First?
- ADO.NET DbContext Generator vs. ADO.NET Poco Entity Generator (ObjectContext)
- How to include a child object’s child object in Entity Framework 5
- Order navigation properties when using Include and/or Select methods with EF 4.1 Code-First?
- Entity framework code-first null foreign key
- How do you ensure Cascade Delete is enabled on a table relationship in EF Code first?
- Ramifications of DbSet.Create versus new Entity()
- How to pass parameters to the DbContext.Database.ExecuteSqlCommand method?
- EF Code First DBContext and Transactions
- How to update not every fields of an object using Entity Framework and EntityState.Modified
- Entity Framework Code First : Setting up One-To-One foreign key association using Annotations
- EF 4.1 loading filtered child collections not working for many-to-many
- Entity Framework Validation confusion – maximum string length of ‘128’
- Using the Entry().CurrentValues.SetValues() is not updating collections
- Entity Framework Code First Many to Many Setup For Existing Tables
- EF4 LINQ Ordering Parent and all child collections with Eager Loading (.Include())
- Disable lazy loading by default in Entity Framework 4
- Best way to check if object exists in Entity Framework? [closed]
- Entity Framework One-To-One Mapping Issues
- Entity Framework 4 selective lazy loading properties
- When should I call SaveChanges() when creating 1000’s of Entity Framework objects? (like during an import)
- Adding Validation Attributes With an Entity Framework Data Model
- ef core 2 apply HasQueryFilter for all entity
- Value cannot be null. Parameter name: entitySet
- EF Code First giving me error Cannot insert explicit value for identity column in table ‘People’ when IDENTITY_INSERT is set to OFF. [duplicate]
- How do I use Entity Framework in Code First Drop-Create mode?
- Entity framework code first delete with cascade