Edit

Share via


DbExtensions Class

Definition

Contains some convenience methods to use in conjunction with IRelationalStorage and GenericRelationalStorage.

public static class DbExtensions
type DbExtensions = class
Public Module DbExtensions
Inheritance
DbExtensions

Methods

AddParameter<T>(IDbCommand, String, T, ParameterDirection, Nullable<Int32>, Nullable<DbType>)

Creates and adds a new SQL parameter to the command.

CreateParameter<T>(IDbCommand, ParameterDirection, String, T, Nullable<Int32>, Nullable<DbType>)

Creates a new SQL parameter using the given arguments.

GetValue<TValue>(IDataRecord, String)

Returns a value with the given .

GetValueAsync<TValue>(DbDataReader, String, CancellationToken)

Returns a value with the given .

GetValueOrDefault<TValue>(IDataRecord, Int32, TValue)

Returns a value if it is not DBNull, default(TValue) otherwise.

GetValueOrDefault<TValue>(IDataRecord, String, TValue)

Returns a value if it is not DBNull, default(TValue) otherwise.

GetValueOrDefaultAsync<TValue>(DbDataReader, Int32, TValue)

Returns a value if it is not DBNull, default(TValue) otherwise.

GetValueOrDefaultAsync<TValue>(DbDataReader, String, TValue)

Returns a value if it is not DBNull, default(TValue) otherwise.

ReflectionParameterProvider<T>(IDbCommand, T, IReadOnlyDictionary<String,String>)

Adds given parameters to a command using reflection.

ReflectionSelector<TResult>(IDataRecord)

Creates object of the given type from the results of a query.

Applies to