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
Remarks
See Implementation of database providers and extensions for more information and examples.
Constructors
RelationalDataReader()
public RelationalDataReader()
Properties
CommandId
A correlation ID that identifies the DbCommand instance being used.
public virtual Guid CommandId { get; }
Property Value
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
RelationalConnection
Gets the underlying relational connection being used.
public virtual IRelationalConnection RelationalConnection { get; }
Property Value
Methods
Close()
Closes the reader.
public virtual void Close()
CloseAsync()
Closes the reader.
public virtual ValueTask CloseAsync()
Returns
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
Initialize(IRelationalConnection, DbCommand, DbDataReader, Guid, IRelationalCommandDiagnosticsLogger?)
Initializes a new instance of the RelationalDataReader class.
public virtual void Initialize(IRelationalConnection relationalConnection, DbCommand command, DbDataReader reader, Guid commandId, IRelationalCommandDiagnosticsLogger? logger)
Parameters
relationalConnection
IRelationalConnectionThe relational 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
IRelationalCommandDiagnosticsLoggerThe diagnostic source.
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