Share via


ObjectContext.LoadProperty Method

Definition

Overloads

LoadProperty(Object, String)

Explicitly loads an object related to the supplied object by the specified navigation property and using the default merge option.

LoadProperty(Object, String, MergeOption)

Explicitly loads an object that is related to the supplied object by the specified navigation property and using the specified merge option.

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.

LoadProperty(Object, String)

Explicitly loads an object related to the supplied object by the specified navigation property and using the default merge option.

public virtual void LoadProperty (object entity, string navigationProperty);
abstract member LoadProperty : obj * string -> unit
override this.LoadProperty : obj * string -> unit
Public Overridable Sub LoadProperty (entity As Object, navigationProperty As String)

Parameters

entity
Object

The entity for which related objects are to be loaded.

navigationProperty
String

The name of the navigation property that returns the related objects to be loaded.

Exceptions

The entity is in a Detached, System.Data.Entity.EntityState.Added, or Deleted state or the entity is attached to another instance of ObjectContext .

Applies to

LoadProperty(Object, String, MergeOption)

Explicitly loads an object that is related to the supplied object by the specified navigation property and using the specified merge option.

public virtual void LoadProperty (object entity, string navigationProperty, System.Data.Entity.Core.Objects.MergeOption mergeOption);
abstract member LoadProperty : obj * string * System.Data.Entity.Core.Objects.MergeOption -> unit
override this.LoadProperty : obj * string * System.Data.Entity.Core.Objects.MergeOption -> unit

Parameters

entity
Object

The entity for which related objects are to be loaded.

navigationProperty
String

The name of the navigation property that returns the related objects to be loaded.

mergeOption
MergeOption

The MergeOption value to use when you load the related objects.

Exceptions

The entity is in a Detached, System.Data.Entity.EntityState.Added, or Deleted state or the entity is attached to another instance of ObjectContext .

Applies to

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.

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
public virtual void LoadProperty<TEntity> (TEntity entity, System.Linq.Expressions.Expression<Func<TEntity,object>> selector);
abstract member LoadProperty : 'Entity * System.Linq.Expressions.Expression<Func<'Entity, obj>> -> unit
override this.LoadProperty : 'Entity * System.Linq.Expressions.Expression<Func<'Entity, obj>> -> unit
Public Overridable Sub LoadProperty(Of TEntity) (entity As TEntity, selector As Expression(Of Func(Of TEntity, Object)))

Type Parameters

TEntity

The type of the entity.

Parameters

entity
TEntity

The source object for which related objects are to be loaded.

selector
Expression<Func<TEntity,Object>>

A LINQ expression that defines the related objects to be loaded.

Attributes

Exceptions

selector does not supply a valid input parameter.

selector is null.

The entity is in a Detached, System.Data.Entity.EntityState.Added, or Deleted state or the entity is attached to another instance of ObjectContext .

Applies to

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.

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
public virtual void LoadProperty<TEntity> (TEntity entity, System.Linq.Expressions.Expression<Func<TEntity,object>> selector, System.Data.Entity.Core.Objects.MergeOption mergeOption);
abstract member LoadProperty : 'Entity * System.Linq.Expressions.Expression<Func<'Entity, obj>> * System.Data.Entity.Core.Objects.MergeOption -> unit
override this.LoadProperty : 'Entity * System.Linq.Expressions.Expression<Func<'Entity, obj>> * System.Data.Entity.Core.Objects.MergeOption -> unit

Type Parameters

TEntity

The type of the entity.

Parameters

entity
TEntity

The source object for which related objects are to be loaded.

selector
Expression<Func<TEntity,Object>>

A LINQ expression that defines the related objects to be loaded.

mergeOption
MergeOption

The MergeOption value to use when you load the related objects.

Attributes

Exceptions

selector does not supply a valid input parameter.

selector is null.

The entity is in a Detached, System.Data.Entity.EntityState.Added, or Deleted state or the entity is attached to another instance of ObjectContext .

Applies to