EntityCommand.ExecuteReaderAsync Method

 

Asynchronously executes the command and returns a data reader for reading the results.

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

NameDescription
System_CAPS_pubmethodExecuteReaderAsync()

Asynchronously executes the command and returns a data reader for reading the results. May only be called on CommandType.CommandText (otherwise, use the standard Execute* methods)

System_CAPS_pubmethodExecuteReaderAsync(CancellationToken)

Asynchronously executes the command and returns a data reader for reading the results. May only be called on CommandType.CommandText (otherwise, use the standard Execute* methods)

System_CAPS_pubmethodExecuteReaderAsync(CommandBehavior)

Asynchronously executes the command and returns a data reader for reading the results. May only be called on CommandType.CommandText (otherwise, use the standard Execute* methods)

System_CAPS_pubmethodExecuteReaderAsync(CommandBehavior, CancellationToken)

Asynchronously executes the command and returns a data reader for reading the results. May only be called on CommandType.CommandText (otherwise, use the standard Execute* methods)


EntityCommand.ExecuteReaderAsync Method ()

Asynchronously executes the command and returns a data reader for reading the results. May only be called on CommandType.CommandText (otherwise, use the standard Execute* methods)

public virtual Task<EntityDataReader> ExecuteReaderAsync()

Return Value

Type: System.Threading.Tasks.Task<EntityDataReader>

A task that represents the asynchronous operation. The task result contains an EntityDataReader object.

Exception Condition
InvalidOperationException

For stored procedure commands, if called for anything but an entity collection result


EntityCommand.ExecuteReaderAsync Method (CancellationToken)

Asynchronously executes the command and returns a data reader for reading the results. May only be called on CommandType.CommandText (otherwise, use the standard Execute* methods)

public virtual Task<EntityDataReader> ExecuteReaderAsync(
	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<EntityDataReader>

A task that represents the asynchronous operation. The task result contains an EntityDataReader object.

Exception Condition
InvalidOperationException

For stored procedure commands, if called for anything but an entity collection result


EntityCommand.ExecuteReaderAsync Method (CommandBehavior)

Asynchronously executes the command and returns a data reader for reading the results. May only be called on CommandType.CommandText (otherwise, use the standard Execute* methods)

public virtual Task<EntityDataReader> ExecuteReaderAsync(
	CommandBehavior behavior
)

Parameters

behavior
Type: System.Data.CommandBehavior

The behavior to use when executing the command

Return Value

Type: System.Threading.Tasks.Task<EntityDataReader>

A task that represents the asynchronous operation. The task result contains an EntityDataReader object.

Exception Condition
InvalidOperationException

For stored procedure commands, if called for anything but an entity collection result


EntityCommand.ExecuteReaderAsync Method (CommandBehavior, CancellationToken)

Asynchronously executes the command and returns a data reader for reading the results. May only be called on CommandType.CommandText (otherwise, use the standard Execute* methods)

[DebuggerStepThroughAttribute]
public virtual Task<EntityDataReader> ExecuteReaderAsync(
	CommandBehavior behavior,
	CancellationToken cancellationToken
)

Parameters

behavior
Type: System.Data.CommandBehavior

The behavior to use when executing the command

cancellationToken
Type: System.Threading.CancellationToken

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

Return Value

Type: System.Threading.Tasks.Task<EntityDataReader>

A task that represents the asynchronous operation. The task result contains an EntityDataReader object.

Exception Condition
InvalidOperationException

For stored procedure commands, if called for anything but an entity collection result