Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

ObjectContext::LoadProperty Method

Entity Framework 6.0
 

Explicitly loads a referenced entity or collection of entities into the given entity.

Namespace:   System.Data.Entity.Core.Objects
Assembly:  EntityFramework (in EntityFramework.dll)

NameDescription
System_CAPS_pubmethodLoadProperty(Object^, String^)

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

System_CAPS_pubmethodLoadProperty(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.

System_CAPS_pubmethodLoadProperty<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_CAPS_pubmethodLoadProperty<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.

Return to top

ObjectContext::LoadProperty Method (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
)

Parameters

entity
Type: System::Object^

The entity for which related objects are to be loaded.

navigationProperty
Type: System::String^

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

Exception Condition
InvalidOperationException

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

Return to top

ObjectContext::LoadProperty Method (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,
	MergeOption mergeOption
)

Parameters

entity
Type: System::Object^

The entity for which related objects are to be loaded.

navigationProperty
Type: System::String^

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

mergeOption
Type: System.Data.Entity.Core.Objects::MergeOption

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

Exception Condition
InvalidOperationException

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

Return to top

ObjectContext::LoadProperty<TEntity> Method (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.

public:
generic<typename TEntity>
[SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
virtual void LoadProperty(
	TEntity entity,
	Expression<Func<TEntity, Object^>^>^ selector
)

Parameters

entity
Type: TEntity

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

selector
Type: System.Linq.Expressions::Expression<Func<TEntity, Object^>^>^

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

Type Parameters

TEntity

The type of the entity.

Exception Condition
ArgumentException

selector does not supply a valid input parameter.

ArgumentNullException

selector is null.

InvalidOperationException

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

Return to top

ObjectContext::LoadProperty<TEntity> Method (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.

public:
generic<typename TEntity>
[SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
virtual void LoadProperty(
	TEntity entity,
	Expression<Func<TEntity, Object^>^>^ selector,
	MergeOption mergeOption
)

Parameters

entity
Type: TEntity

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

selector
Type: System.Linq.Expressions::Expression<Func<TEntity, Object^>^>^

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

mergeOption
Type: System.Data.Entity.Core.Objects::MergeOption

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

Type Parameters

TEntity

The type of the entity.

Exception Condition
ArgumentException

selector does not supply a valid input parameter.

ArgumentNullException

selector is null.

InvalidOperationException

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

Return to top
Show: