ObjectContext.LoadProperty<TEntity> Method
[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]
Explicitly loads an object that is related to the supplied object by the specified LINQ query when you are using persistence ignorant custom data classes.
| Name | Description | |
|---|---|---|
|
LoadProperty<TEntity>(TEntity, Expression<Func<TEntity, Object>>) | Explicitly loads an object that is related to the supplied object by the specified LINQ query and by using the default merge option. |
|
LoadProperty<TEntity>(TEntity, Expression<Func<TEntity, Object>>, MergeOption) | Explicitly loads an object that is related to the supplied object by the specified LINQ query and by using the specified merge option. |
When using persistence ignorant custom data classes, related objects cannot be explicitly loaded like instances of entity types that are generated by the Entity Data Model tools. This is because the tools generate the navigation properties that return an EntityCollection<TEntity> or EntityReference<TEntity> of related objects when the Load method is called on a RelatedEnd. Persistence ignorant objects can still be loaded by using lazy loading by setting the LazyLoadingEnabled property to true on the instance of ObjectContextOptions that is returned by the ObjectContext.ContextOptions property, or by using eager loading with the Include method on the ObjectQuery<T>.