Table of Contents

Class CommandExtensions

Namespace
Open.Database.Extensions
Assembly
Open.Database.Extensions.Core.dll

Provides extension methods that execute a command and read its results.

public static class CommandExtensions
Inheritance
CommandExtensions
Inherited Members

Methods

AddParameter(IDbCommand, string, DateTime)

Adds a date and time parameter (DateTime) with the given name and value to the command.

AddParameter(IDbCommand, string, DateTimeOffset)

Adds a date and time with offset parameter (DateTimeOffset) with the given name and value to the command.

AddParameter(IDbCommand, string, decimal)

Adds a decimal parameter (Decimal) with the given name and value to the command.

AddParameter(IDbCommand, string, double)

Adds a double-precision floating point parameter (Double) with the given name and value to the command.

AddParameter(IDbCommand, string, Guid)

Adds a GUID parameter (Guid) with the given name and value to the command.

AddParameter(IDbCommand, string, short)

Adds a 16-bit integer parameter (Int16) with the given name and value to the command.

AddParameter(IDbCommand, string, int)

Adds a 32-bit integer parameter (Int32) with the given name and value to the command.

AddParameter(IDbCommand, string, long)

Adds a 64-bit integer parameter (Int64) with the given name and value to the command.

AddParameter(IDbCommand, string, object?)

Adds a parameter with the given name and value to the command, leaving the provider to infer the database type from the value.

AddParameter(IDbCommand, string, object?, DbType, ParameterDirection)

Adds a typed parameter with the given name, value, and direction to the command.

AddParameter(IDbCommand, string, string?)

Adds a string parameter (String) with the given name and value to the command.

AddParameterType(IDbCommand, string?, DbType, ParameterDirection)

Adds a parameter of the given type and direction to the command without assigning a value.

AddReturnParameter(IDbCommand, DbType, string?)

Adds a typed return-value parameter to the command.

AddReturnParameter(IDbCommand, string?)

Adds a return-value parameter to the command, leaving the provider to determine its type.

ExecuteReaderAsync(DbCommand, Action<DbDataReader>, CommandBehavior, CancellationToken)

Asynchronously executes a reader and passes it to a handler.

ExecuteReaderAsync(DbCommand, Action<DbDataReader>, CancellationToken)

Asynchronously executes a reader and passes it to a handler.

ExecuteReaderAsync(DbCommand, Func<DbDataReader, ValueTask>, CommandBehavior, CancellationToken)

Asynchronously executes a reader and passes it to an asynchronous handler.

ExecuteReaderAsync(DbCommand, Func<DbDataReader, ValueTask>, CancellationToken)

Asynchronously executes a reader and passes it to an asynchronous handler.

ExecuteReaderAsync(IDbCommand, CommandBehavior, CancellationToken)

Asynchronously executes a reader, calling ExecuteReaderAsync(CommandBehavior, CancellationToken) if the command is derived from DbCommand; otherwise it calls ExecuteReader(CommandBehavior).

ExecuteReaderAsync(IDbCommand, Func<IDataReader, ValueTask>, CommandBehavior, CancellationToken)

Asynchronously executes a reader and passes it to an asynchronous handler.

ExecuteReaderAsync(IDbCommand, Func<IDataReader, ValueTask>, CancellationToken)

Asynchronously executes a reader and passes it to an asynchronous handler.

ExecuteReaderAsync(IDbCommand, CancellationToken)

Asynchronously executes a reader, calling ExecuteReaderAsync(CommandBehavior, CancellationToken) if the command is derived from DbCommand; otherwise it calls ExecuteReader(CommandBehavior).

ExecuteReaderAsync<T>(DbCommand, Func<DbDataReader, ValueTask<T>>, CommandBehavior, CancellationToken)

Asynchronously executes a reader and returns the result of a transform function applied to it.

ExecuteReaderAsync<T>(DbCommand, Func<DbDataReader, ValueTask<T>>, CancellationToken)

Asynchronously executes a reader and returns the result of a transform function applied to it.

ExecuteReaderAsync<T>(DbCommand, Func<DbDataReader, T>, CommandBehavior, CancellationToken)

Asynchronously executes a reader and returns the result of a transform function applied to it.

ExecuteReaderAsync<T>(DbCommand, Func<DbDataReader, T>, CancellationToken)

Asynchronously executes a reader and returns the result of a transform function applied to it.

ExecuteReaderAsync<T>(IDbCommand, Func<IDataReader, ValueTask<T>>, CommandBehavior, CancellationToken)

Asynchronously executes a reader and returns the result of a transform function applied to it.

ExecuteReaderAsync<T>(IDbCommand, Func<IDataReader, ValueTask<T>>, CancellationToken)

Asynchronously executes a reader and returns the result of a transform function applied to it.