Share via


RelationalCommand Class

Definition

A command to be executed against a relational database.

This type is typically used by database providers (and other extensions). It is generally not used in application code.

public class RelationalCommand : Microsoft.EntityFrameworkCore.Storage.IRelationalCommand
type RelationalCommand = class
    interface IRelationalCommand
type RelationalCommand = class
    interface IRelationalCommand
    interface IRelationalCommandTemplate
Public Class RelationalCommand
Implements IRelationalCommand
Inheritance
RelationalCommand
Implements

Remarks

See Implementation of database providers and extensions for more information and examples.

Constructors

RelationalCommand(RelationalCommandBuilderDependencies, String, IReadOnlyList<IRelationalParameter>)

Constructs a new RelationalCommand.

This type is typically used by database providers (and other extensions). It is generally not used in application code.

Properties

CommandText

Gets the command text to be executed.

Dependencies

Relational provider-specific dependencies for this service.

Parameters

Gets the parameters for the command.

Methods

CreateCommand(RelationalCommandParameterObject, Guid, DbCommandMethod)

Template method called by the execute methods to create a DbCommand for the given DbConnection and configure timeouts and transactions.

This method is typically used by database providers (and other extensions). It is generally not used in application code.

CreateDbCommand(RelationalCommandParameterObject, Guid, DbCommandMethod)

Called by the execute methods to create a DbCommand for the given DbConnection and configure timeouts and transactions.

This method is typically used by database providers (and other extensions). It is generally not used in application code.

CreateRelationalDataReader()

Creates a new RelationalDataReader to be used by ExecuteReader(RelationalCommandParameterObject) and ExecuteReaderAsync(RelationalCommandParameterObject, CancellationToken). The returned RelationalDataReader may get used more for multiple queries, and will be re-initialized each time via Initialize(IRelationalConnection, DbCommand, DbDataReader, Guid, IRelationalCommandDiagnosticsLogger).

This method is typically used by database providers (and other extensions). It is generally not used in application code.

CreateRelationalDataReader(IRelationalConnection, DbCommand, DbDataReader, Guid, IDiagnosticsLogger<DbLoggerCategory.Database.Command>)

Creates a new RelationalDataReader to be used by ExecuteReader(RelationalCommandParameterObject) and ExecuteReaderAsync(RelationalCommandParameterObject, CancellationToken).

This method is typically used by database providers (and other extensions). It is generally not used in application code.

ExecuteNonQuery(RelationalCommandParameterObject)

Executes the command with no results.

ExecuteNonQueryAsync(RelationalCommandParameterObject, CancellationToken)

Asynchronously executes the command with no results.

ExecuteReader(RelationalCommandParameterObject)

Executes the command with a RelationalDataReader result.

ExecuteReaderAsync(RelationalCommandParameterObject, CancellationToken)

Asynchronously executes the command with a RelationalDataReader result.

ExecuteScalar(RelationalCommandParameterObject)

Executes the command with a single scalar result.

ExecuteScalarAsync(RelationalCommandParameterObject, CancellationToken)

Asynchronously executes the command with a single scalar result.

PopulateFrom(IRelationalCommandTemplate)

Populates this command from the provided commandTemplate.

Applies to