Class RelationalDataReader
- Namespace
- Microsoft.EntityFrameworkCore.Storage
- Assembly
- Microsoft.EntityFrameworkCore.Relational.dll
Reads result sets from a relational database.
This type is typically used by database providers (and other extensions). It is generally not used in application code.
public class RelationalDataReader : IDisposable, IAsyncDisposable
- Inheritance
-
RelationalDataReader
- Implements
- Inherited Members
Constructors
RelationalDataReader(IRelationalConnection, DbCommand, DbDataReader, Guid, IDiagnosticsLogger<Command>)
Initializes a new instance of the RelationalDataReader class.
public RelationalDataReader(IRelationalConnection connection, DbCommand command, DbDataReader reader, Guid commandId, IDiagnosticsLogger<DbLoggerCategory.Database.Command> logger)
Parameters
connection
IRelationalConnectionThe connection.
command
DbCommandThe command that was executed.
reader
DbDataReaderThe underlying reader for the result set.
commandId
GuidA correlation ID that identifies the DbCommand instance being used.
logger
IDiagnosticsLogger<Command>The diagnostic source.
Properties
DbCommand
Gets the underlying command for the result set.
public virtual DbCommand DbCommand { get; }
Property Value
DbDataReader
Gets the underlying reader for the result set.
public virtual DbDataReader DbDataReader { get; }
Property Value
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public virtual void Dispose()
DisposeAsync()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public virtual ValueTask DisposeAsync()
Returns
Read()
Calls Read() on the underlying DbDataReader.
public virtual bool Read()
Returns
ReadAsync(CancellationToken)
Calls ReadAsync(CancellationToken) on the underlying DbDataReader.
public virtual Task<bool> ReadAsync(CancellationToken cancellationToken = default)
Parameters
cancellationToken
CancellationToken