Share via


EntityCommand.ExecuteReaderAsync Method

Definition

Overloads

ExecuteReaderAsync(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)

ExecuteReaderAsync(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)

ExecuteReaderAsync(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)

ExecuteReaderAsync()

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)

ExecuteReaderAsync(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)

[System.Diagnostics.DebuggerStepThrough]
public virtual System.Threading.Tasks.Task<System.Data.Entity.Core.EntityClient.EntityDataReader> ExecuteReaderAsync (System.Data.CommandBehavior behavior, System.Threading.CancellationToken cancellationToken);
override this.ExecuteReaderAsync : System.Data.CommandBehavior * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Data.Entity.Core.EntityClient.EntityDataReader>

Parameters

behavior
CommandBehavior

The behavior to use when executing the command

cancellationToken
CancellationToken

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

Returns

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

Attributes

Exceptions

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

Applies to

ExecuteReaderAsync(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 System.Threading.Tasks.Task<System.Data.Entity.Core.EntityClient.EntityDataReader> ExecuteReaderAsync (System.Threading.CancellationToken cancellationToken);
override this.ExecuteReaderAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Data.Entity.Core.EntityClient.EntityDataReader>

Parameters

cancellationToken
CancellationToken

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

Returns

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

Exceptions

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

Applies to

ExecuteReaderAsync(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 System.Threading.Tasks.Task<System.Data.Entity.Core.EntityClient.EntityDataReader> ExecuteReaderAsync (System.Data.CommandBehavior behavior);
override this.ExecuteReaderAsync : System.Data.CommandBehavior -> System.Threading.Tasks.Task<System.Data.Entity.Core.EntityClient.EntityDataReader>
Public Overridable Function ExecuteReaderAsync (behavior As CommandBehavior) As Task(Of EntityDataReader)

Parameters

behavior
CommandBehavior

The behavior to use when executing the command

Returns

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

Exceptions

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

Applies to

ExecuteReaderAsync()

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 System.Threading.Tasks.Task<System.Data.Entity.Core.EntityClient.EntityDataReader> ExecuteReaderAsync ();
override this.ExecuteReaderAsync : unit -> System.Threading.Tasks.Task<System.Data.Entity.Core.EntityClient.EntityDataReader>
Public Overridable Function ExecuteReaderAsync () As Task(Of EntityDataReader)

Returns

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

Exceptions

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

Applies to