RelatedEnd.LoadAsync Method

 

Asynchronously loads the related entity or entities into the related end using the supplied merge option.

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

NameDescription
System_CAPS_pubmethodLoadAsync(CancellationToken)

Asynchronously loads the related object or objects into the related end with the default merge option.

System_CAPS_pubmethodLoadAsync(MergeOption, CancellationToken)

Asynchronously loads an object or objects from the related end with the specified merge option.


RelatedEnd.LoadAsync Method (CancellationToken)

Asynchronously loads the related object or objects into the related end with the default merge option.

public Task LoadAsync(
	CancellationToken cancellationToken
)

Parameters

cancellationToken
Type: System.Threading.CancellationToken

A CancellationToken to observe while waiting for the task to complete.

Return Value

Type: System.Threading.Tasks.Task

A task that represents the asynchronous operation.

Exception Condition
InvalidOperationException

When the source object was retrieved by using a NoTracking query and the MergeOption is not NoTracking or the related objects are already loaded or when the source object is not attached to the ObjectContext or when the source object is being tracked but is in the Added or Deleted state or the MergeOption used for Load is NoTracking.

Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.


RelatedEnd.LoadAsync Method (MergeOption, CancellationToken)

Asynchronously loads an object or objects from the related end with the specified merge option.

public abstract Task LoadAsync(
	MergeOption mergeOption,
	CancellationToken cancellationToken
)

Parameters

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

The MergeOption to use when merging objects into an existing EntityCollection<TEntity>.

cancellationToken
Type: System.Threading.CancellationToken

A CancellationToken to observe while waiting for the task to complete.

Return Value

Type: System.Threading.Tasks.Task

A task that represents the asynchronous operation.

Exception Condition
InvalidOperationException

When the source object was retrieved by using a NoTracking query and the MergeOption is not NoTracking or the related objects are already loaded or when the source object is not attached to the ObjectContext or when the source object is being tracked but is in the Added or Deleted state or the MergeOption used for Load is NoTracking.

Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.