Table of Contents

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 IRelationalConnection

The connection.

command DbCommand

The command that was executed.

reader DbDataReader

The underlying reader for the result set.

commandId Guid

A 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

DbCommand

DbDataReader

Gets the underlying reader for the result set.

public virtual DbDataReader DbDataReader { get; }

Property Value

DbDataReader

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

ValueTask

Read()

Calls Read() on the underlying DbDataReader.

public virtual bool Read()

Returns

bool

true if there are more rows; otherwise false.

ReadAsync(CancellationToken)

Calls ReadAsync(CancellationToken) on the underlying DbDataReader.

public virtual Task<bool> ReadAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Returns

Task<bool>

true if there are more rows; otherwise false.