EntityCommand.ExecuteReaderAsync Method
Asynchronously executes the command and returns a data reader for reading the results.
Assembly: EntityFramework (in EntityFramework.dll)
Name | Description | |
---|---|---|
![]() | 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(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(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)
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)
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 |