IRelationalCommand IRelationalCommand Interface

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 interface IRelationalCommand
Public Interface IRelationalCommand

Properties

CommandText CommandText

Gets the command text to be executed.

string CommandText { get; }
ReadOnly Property CommandText As String
Value
System.String System.String

Parameters Parameters

Gets the parameters for the command.

IReadOnlyList<IRelationalParameter> Parameters { get; }
ReadOnly Property Parameters As IReadOnlyList(Of IRelationalParameter)
Value
System.Collections.Generic.IReadOnlyList<IRelationalParameter> System.Collections.Generic.IReadOnlyList(Of IRelationalParameter)

Methods

ExecuteNonQuery(IRelationalConnection, IReadOnlyDictionary) ExecuteNonQuery(IRelationalConnection, IReadOnlyDictionary(Of String, Object))

Executes the command with no results.

int ExecuteNonQuery(IRelationalConnection connection, IReadOnlyDictionary<string, object> parameterValues)
Function ExecuteNonQuery(connection As IRelationalConnection, parameterValues As IReadOnlyDictionary(Of String, Object)) As Integer
Parameters
connection
IRelationalConnection IRelationalConnection

The connection to execute against.

parameterValues
System.Collections.Generic.IReadOnlyDictionary<System.String, System.Object> System.Collections.Generic.IReadOnlyDictionary(Of System.String, System.Object)

The values for the parameters.

Returns
System.Int32 System.Int32

The number of rows affected.

ExecuteNonQueryAsync(IRelationalConnection, IReadOnlyDictionary, CancellationToken) ExecuteNonQueryAsync(IRelationalConnection, IReadOnlyDictionary(Of String, Object), CancellationToken)

Asynchronously executes the command with no results.

Task<int> ExecuteNonQueryAsync(IRelationalConnection connection, IReadOnlyDictionary<string, object> parameterValues, CancellationToken cancellationToken = null)
Function ExecuteNonQueryAsync(connection As IRelationalConnection, parameterValues As IReadOnlyDictionary(Of String, Object), cancellationToken As CancellationToken = Nothing) As Task(Of Integer)
Parameters
connection
IRelationalConnection IRelationalConnection

The connection to execute against.

parameterValues
System.Collections.Generic.IReadOnlyDictionary<System.String, System.Object> System.Collections.Generic.IReadOnlyDictionary(Of System.String, System.Object)

The values for the parameters.

cancellationToken
System.Threading.CancellationToken System.Threading.CancellationToken

A System.Threading.CancellationToken to observe while waiting for the task to complete.

Returns
System.Threading.Tasks.Task<System.Int32> System.Threading.Tasks.Task(Of System.Int32)

A task that represents the asynchronous operation. The task result contains the number of rows affected.

ExecuteReader(IRelationalConnection, IReadOnlyDictionary) ExecuteReader(IRelationalConnection, IReadOnlyDictionary(Of String, Object))

Executes the command with a RelationalDataReader result.

RelationalDataReader ExecuteReader(IRelationalConnection connection, IReadOnlyDictionary<string, object> parameterValues)
Function ExecuteReader(connection As IRelationalConnection, parameterValues As IReadOnlyDictionary(Of String, Object)) As RelationalDataReader
Parameters
connection
IRelationalConnection IRelationalConnection

The connection to execute against.

parameterValues
System.Collections.Generic.IReadOnlyDictionary<System.String, System.Object> System.Collections.Generic.IReadOnlyDictionary(Of System.String, System.Object)

The values for the parameters.

Returns

The result of the command.

ExecuteReaderAsync(IRelationalConnection, IReadOnlyDictionary, CancellationToken) ExecuteReaderAsync(IRelationalConnection, IReadOnlyDictionary(Of String, Object), CancellationToken)

Asynchronously executes the command with a RelationalDataReader result.

Task<RelationalDataReader> ExecuteReaderAsync(IRelationalConnection connection, IReadOnlyDictionary<string, object> parameterValues, CancellationToken cancellationToken = null)
Function ExecuteReaderAsync(connection As IRelationalConnection, parameterValues As IReadOnlyDictionary(Of String, Object), cancellationToken As CancellationToken = Nothing) As Task(Of RelationalDataReader)
Parameters
connection
IRelationalConnection IRelationalConnection

The connection to execute against.

parameterValues
System.Collections.Generic.IReadOnlyDictionary<System.String, System.Object> System.Collections.Generic.IReadOnlyDictionary(Of System.String, System.Object)

The values for the parameters.

cancellationToken
System.Threading.CancellationToken System.Threading.CancellationToken

A System.Threading.CancellationToken to observe while waiting for the task to complete.

Returns
System.Threading.Tasks.Task<RelationalDataReader> System.Threading.Tasks.Task(Of RelationalDataReader)

A task that represents the asynchronous operation. The task result contains the result of the command.

ExecuteScalar(IRelationalConnection, IReadOnlyDictionary) ExecuteScalar(IRelationalConnection, IReadOnlyDictionary(Of String, Object))

Executes the command with a single scalar result.

object ExecuteScalar(IRelationalConnection connection, IReadOnlyDictionary<string, object> parameterValues)
Function ExecuteScalar(connection As IRelationalConnection, parameterValues As IReadOnlyDictionary(Of String, Object)) As Object
Parameters
connection
IRelationalConnection IRelationalConnection

The connection to execute against.

parameterValues
System.Collections.Generic.IReadOnlyDictionary<System.String, System.Object> System.Collections.Generic.IReadOnlyDictionary(Of System.String, System.Object)

The values for the parameters.

Returns
System.Object System.Object

The result of the command.

ExecuteScalarAsync(IRelationalConnection, IReadOnlyDictionary, CancellationToken) ExecuteScalarAsync(IRelationalConnection, IReadOnlyDictionary(Of String, Object), CancellationToken)

Asynchronously executes the command with a single scalar result.

Task<object> ExecuteScalarAsync(IRelationalConnection connection, IReadOnlyDictionary<string, object> parameterValues, CancellationToken cancellationToken = null)
Function ExecuteScalarAsync(connection As IRelationalConnection, parameterValues As IReadOnlyDictionary(Of String, Object), cancellationToken As CancellationToken = Nothing) As Task(Of Object)
Parameters
connection
IRelationalConnection IRelationalConnection

The connection to execute against.

parameterValues
System.Collections.Generic.IReadOnlyDictionary<System.String, System.Object> System.Collections.Generic.IReadOnlyDictionary(Of System.String, System.Object)

The values for the parameters.

cancellationToken
System.Threading.CancellationToken System.Threading.CancellationToken

A System.Threading.CancellationToken to observe while waiting for the task to complete.

Returns
System.Threading.Tasks.Task<System.Object> System.Threading.Tasks.Task(Of System.Object)

A task that represents the asynchronous operation. The task result contains the result of the command.