If you include the library System.Data.Entity
you can use an overload of the Include()
method which takes a lambda expression instead of a string. You can then Select()
over children with Linq expressions rather than string
paths.
return DatabaseContext.Applications
.Include(a => a.Children.Select(c => c.ChildRelationshipType));
More Related Contents:
- What’s the difference(s) between .ToList(), .AsEnumerable(), AsQueryable()?
- Entity Framework Join 3 Tables
- ADO.NET DbContext Generator vs. ADO.NET Poco Entity Generator (ObjectContext)
- Validation failed for one or more entities. See ‘EntityValidationErrors’ property for more details [duplicate]
- The relationship could not be changed because one or more of the foreign-key properties is non-nullable
- Disable lazy loading by default in Entity Framework 4
- Batch update/delete EF5
- How do I detach objects in Entity Framework Code First?
- Entity Framework 4 / POCO – Where to start? [closed]
- Debug code-first Entity Framework migration codes
- Asp.Net Web API Error: The ‘ObjectContent`1’ type failed to serialize the response body for content type ‘application/xml; charset=utf-8’
- Order navigation properties when using Include and/or Select methods with EF 4.1 Code-First?
- Entity framework code-first null foreign key
- Unique keys in Entity Framework 4
- Upgrade EF 4 EDMX to EF 6
- How do you ensure Cascade Delete is enabled on a table relationship in EF Code first?
- Querying objects after AddObject before SaveChanges?
- Entity Framework 4.1 default eager loading
- Use Entity framework I want to include only first children objects and not child of child(sub of sub)
- EF Code First giving me error Cannot insert explicit value for identity column in table ‘People’ when IDENTITY_INSERT is set to OFF. [duplicate]
- EF Code First DBContext and Transactions
- Entity Framework Code First : Setting up One-To-One foreign key association using Annotations
- Map two different entities to the same table?
- How to use Entity Framework to map results of a stored procedure to entity with differently named parameters
- Entity Framework Code First Using Guid as Identity with another Identity Column
- AutomaticMigrationsEnabled false or true?
- Entity Framework Validation confusion – maximum string length of ‘128’
- Entity Framework Code First Many to Many Setup For Existing Tables
- Compose queries across Entity Data Models
- Changing Inherited Types in Entity Framework