Class DatabaseConnectorExtensions
Inheritance
Namespace: Paradigm.ORM.Data.Extensions
Assembly: Paradigm.ORM.Data.dll
Syntax
public static class DatabaseConnectorExtensions : object
Methods
| Improve this Doc View SourceCreateCommand(IDatabaseConnector, String)
Creates a database command.
Declaration
public static IDatabaseCommand CreateCommand(this IDatabaseConnector connector, string commandText)
Parameters
Type | Name | Description |
---|---|---|
IDatabaseConnector | connector | The database connector. |
System.String | commandText | The command text. |
Returns
Type | Description |
---|---|
IDatabaseCommand | A database command. |
CreateCommand<TParameters>(IDatabaseConnector, String)
Creates a database command.
Declaration
public static IDatabaseCommand CreateCommand<TParameters>(this IDatabaseConnector connector, string commandText)
Parameters
Type | Name | Description |
---|---|---|
IDatabaseConnector | connector | The databaseconnector. |
System.String | commandText | The command text. |
Returns
Type | Description |
---|---|
IDatabaseCommand | A database command. |
Type Parameters
Name | Description |
---|---|
TParameters | The type of a class containing the parameters. |
CreateCommand<TParameters>(IDatabaseConnector, String, TParameters)
Creates a database command and populates the parameter values.
Declaration
public static IDatabaseCommand CreateCommand<TParameters>(this IDatabaseConnector connector, string commandText, TParameters parameters)
Parameters
Type | Name | Description |
---|---|---|
IDatabaseConnector | connector | The database connector. |
System.String | commandText | The command text. |
TParameters | parameters | The parameter type instance. |
Returns
Type | Description |
---|---|
IDatabaseCommand | A database command. |
Type Parameters
Name | Description |
---|---|
TParameters | The type of a class containing the parameters. |
CreateCommand<TParameters>(IDatabaseConnector, String, TParameters, String[])
Creates a database command and populates the parameter values.
Declaration
public static IDatabaseCommand CreateCommand<TParameters>(this IDatabaseConnector connector, string commandText, TParameters parameters, params string[] ignoreProperties)
Parameters
Type | Name | Description |
---|---|---|
IDatabaseConnector | connector | The database connector. |
System.String | commandText | The command text. |
TParameters | parameters | The parameter type instance. |
System.String[] | ignoreProperties | A list with properties to ignore. |
Returns
Type | Description |
---|---|
IDatabaseCommand | A database command. |
Type Parameters
Name | Description |
---|---|
TParameters | The type of a class containing the parameters. |
CreateCommand<TParameters>(IDatabaseConnector, String, CommandType)
Creates a database command.
Declaration
public static IDatabaseCommand CreateCommand<TParameters>(this IDatabaseConnector connector, string commandText, CommandType commandType)
Parameters
Type | Name | Description |
---|---|---|
IDatabaseConnector | connector | The database connector. |
System.String | commandText | The command text. |
CommandType | commandType | Type of the command. |
Returns
Type | Description |
---|---|
IDatabaseCommand | A database command. |
Type Parameters
Name | Description |
---|---|
TParameters | The type of a class containing the parameters. |
CreateCommand<TParameters>(IDatabaseConnector, String, CommandType, TParameters)
Creates a database command and populates the parameter values.
Declaration
public static IDatabaseCommand CreateCommand<TParameters>(this IDatabaseConnector connector, string commandText, CommandType commandType, TParameters parameters)
Parameters
Type | Name | Description |
---|---|---|
IDatabaseConnector | connector | The database connector. |
System.String | commandText | The command text. |
CommandType | commandType | Type of the command. |
TParameters | parameters | The parameter type instance. |
Returns
Type | Description |
---|---|
IDatabaseCommand | A database command. |
Type Parameters
Name | Description |
---|---|
TParameters | The type of a class containing the parameters. |
CreateCommand<TParameters>(IDatabaseConnector, String, CommandType, TParameters, String[])
Creates a database command and populates the parameter values.
Declaration
public static IDatabaseCommand CreateCommand<TParameters>(this IDatabaseConnector connector, string commandText, CommandType commandType, TParameters parameters, params string[] ignoreProperties)
Parameters
Type | Name | Description |
---|---|---|
IDatabaseConnector | connector | The database connector. |
System.String | commandText | The command text. |
CommandType | commandType | Type of the command. |
TParameters | parameters | The parameter type instance. |
System.String[] | ignoreProperties | A list with properties to ignore. |
Returns
Type | Description |
---|---|
IDatabaseCommand | A database command. |
Type Parameters
Name | Description |
---|---|
TParameters | The type of a class containing the parameters. |
CreateCommand<TParameters>(IDatabaseConnector, String, CommandType, IRoutineTypeDescriptor)
Creates a database command.
Declaration
public static IDatabaseCommand CreateCommand<TParameters>(this IDatabaseConnector connector, string commandText, CommandType commandType, IRoutineTypeDescriptor descriptor)
Parameters
Type | Name | Description |
---|---|---|
IDatabaseConnector | connector | The databaseconnector. |
System.String | commandText | The command text. |
CommandType | commandType | Type of the command. |
IRoutineTypeDescriptor | descriptor | A routine type descriptor for the parameters. |
Returns
Type | Description |
---|---|
IDatabaseCommand | A database command. |
Type Parameters
Name | Description |
---|---|
TParameters | The type of a class containing the parameters. |
CreateCommand<TParameters>(IDatabaseConnector, String, IRoutineTypeDescriptor)
Creates a database command.
Declaration
public static IDatabaseCommand CreateCommand<TParameters>(this IDatabaseConnector connector, string commandText, IRoutineTypeDescriptor descriptor)
Parameters
Type | Name | Description |
---|---|---|
IDatabaseConnector | connector | The database connector. |
System.String | commandText | The command text. |
IRoutineTypeDescriptor | descriptor | The routine type descriptor. |
Returns
Type | Description |
---|---|
IDatabaseCommand | A database command. |
Type Parameters
Name | Description |
---|---|
TParameters | The type of a class containing the parameters. |
CustomQuery<TResultType>(IDatabaseConnector, String, String, Object[])
Executes a query and return the results.
Declaration
public static List<TResultType> CustomQuery<TResultType>(this IDatabaseConnector connector, string query, string whereClause = null, params object[] parameters)where TResultType : class
Parameters
Type | Name | Description |
---|---|---|
IDatabaseConnector | connector | The database connector. |
System.String | query | A custom commandText string. The select columns should be mapped to the |
System.String | whereClause | A where filter clause. Do not add the "WHERE" keyword to it. If you need to pass parameters, pass using @1, @2, @3. |
System.Object[] | parameters | A list of parameter values. |
Returns
Type | Description |
---|---|
List<TResultType> | A list of |
Type Parameters
Name | Description |
---|---|
TResultType | The result type. |
See Also
CustomQueryAsync<TResultType>(IDatabaseConnector, String, String, Object[])
Executes a query and return the results.
Declaration
public static Task<List<TResultType>> CustomQueryAsync<TResultType>(this IDatabaseConnector connector, string query, string whereClause = null, params object[] parameters)where TResultType : class
Parameters
Type | Name | Description |
---|---|---|
IDatabaseConnector | connector | The database connector. |
System.String | query | A custom commandText string. The select columns should be mapped to the |
System.String | whereClause | A where filter clause. Do not add the "WHERE" keyword to it. If you need to pass parameters, pass using @1, @2, @3. |
System.Object[] | parameters | A list of parameter values. |
Returns
Type | Description |
---|---|
Task<List<TResultType>> | A list of |
Type Parameters
Name | Description |
---|---|
TResultType | The result type. |
See Also
ExecuteNonQuery(IDatabaseConnector, IDatabaseCommand)
Executes a database command as non query.
Declaration
public static void ExecuteNonQuery(this IDatabaseConnector connector, IDatabaseCommand command)
Parameters
Type | Name | Description |
---|---|---|
IDatabaseConnector | connector | The database connector. |
IDatabaseCommand | command | The database command. |
ExecuteNonQuery(IDatabaseConnector, IDatabaseCommand, Action<Int32>)
Executes a database command as non query.
Declaration
public static void ExecuteNonQuery(this IDatabaseConnector connector, IDatabaseCommand command, Action<int> action)
Parameters
Type | Name | Description |
---|---|---|
IDatabaseConnector | connector | The database connector. |
IDatabaseCommand | command | The database command. |
Action<System.Int32> | action | A callback action to process the affected rows quantity. |
ExecuteNonQuery(IDatabaseConnector, String)
Executes a database command as non query.
Declaration
public static void ExecuteNonQuery(this IDatabaseConnector connector, string commandText)
Parameters
Type | Name | Description |
---|---|---|
IDatabaseConnector | connector | The database connector. |
System.String | commandText | The command text. |
ExecuteNonQuery(IDatabaseConnector, String, Action<Int32>)
Executes a database command as non query.
Declaration
public static void ExecuteNonQuery(this IDatabaseConnector connector, string commandText, Action<int> action)
Parameters
Type | Name | Description |
---|---|---|
IDatabaseConnector | connector | The database connector. |
System.String | commandText | The command text. |
Action<System.Int32> | action | A callback action to process the affected rows quantity. |
ExecuteNonQuery<T>(IDatabaseConnector, IDatabaseCommand, Func<Int32, T>)
Executes a database command as non query.
Declaration
public static T ExecuteNonQuery<T>(this IDatabaseConnector connector, IDatabaseCommand command, Func<int, T> action)
Parameters
Type | Name | Description |
---|---|---|
IDatabaseConnector | connector | The database connector. |
IDatabaseCommand | command | The database command. |
Func<System.Int32, T> | action | A callback action to process the affected rows quantity. |
Returns
Type | Description |
---|---|
T |
Type Parameters
Name | Description |
---|---|
T |
ExecuteNonQuery<T>(IDatabaseConnector, String, Func<Int32, T>)
Executes a database command as non query.
Declaration
public static T ExecuteNonQuery<T>(this IDatabaseConnector connector, string commandText, Func<int, T> action)
Parameters
Type | Name | Description |
---|---|---|
IDatabaseConnector | connector | The database connector. |
System.String | commandText | The command text. |
Func<System.Int32, T> | action | A callback action to process the affected rows quantity. |
Returns
Type | Description |
---|---|
T |
Type Parameters
Name | Description |
---|---|
T |
ExecuteNonQueryAsync(IDatabaseConnector, IDatabaseCommand)
Executes a database command as non query.
Declaration
public static Task ExecuteNonQueryAsync(this IDatabaseConnector connector, IDatabaseCommand command)
Parameters
Type | Name | Description |
---|---|---|
IDatabaseConnector | connector | The database connector. |
IDatabaseCommand | command | The database command. |
Returns
Type | Description |
---|---|
Task |
ExecuteNonQueryAsync(IDatabaseConnector, IDatabaseCommand, Action<Int32>)
Executes a database command as non query.
Declaration
public static Task ExecuteNonQueryAsync(this IDatabaseConnector connector, IDatabaseCommand command, Action<int> action)
Parameters
Type | Name | Description |
---|---|---|
IDatabaseConnector | connector | The database connector. |
IDatabaseCommand | command | The database command. |
Action<System.Int32> | action | A callback action to process the affected rows quantity. |
Returns
Type | Description |
---|---|
Task |
ExecuteNonQueryAsync(IDatabaseConnector, IDatabaseCommand, Func<Int32, Task>)
Executes a database command as non query.
Declaration
public static Task ExecuteNonQueryAsync(this IDatabaseConnector connector, IDatabaseCommand command, Func<int, Task> action)
Parameters
Type | Name | Description |
---|---|---|
IDatabaseConnector | connector | The database connector. |
IDatabaseCommand | command | The database command. |
Func<System.Int32, Task> | action | A callback action to process the affected rows quantity. |
Returns
Type | Description |
---|---|
Task |
ExecuteNonQueryAsync(IDatabaseConnector, String)
Executes a database command as non query.
Declaration
public static Task ExecuteNonQueryAsync(this IDatabaseConnector connector, string commandText)
Parameters
Type | Name | Description |
---|---|---|
IDatabaseConnector | connector | The database connector. |
System.String | commandText | The command text. |
Returns
Type | Description |
---|---|
Task |
ExecuteNonQueryAsync(IDatabaseConnector, String, Action<Int32>)
Executes a database command as non query.
Declaration
public static Task ExecuteNonQueryAsync(this IDatabaseConnector connector, string commandText, Action<int> action)
Parameters
Type | Name | Description |
---|---|---|
IDatabaseConnector | connector | The database connector. |
System.String | commandText | The command text. |
Action<System.Int32> | action | A callback action to process the affected rows quantity. |
Returns
Type | Description |
---|---|
Task |
ExecuteNonQueryAsync(IDatabaseConnector, String, Func<Int32, Task>)
Executes a database command as non query.
Declaration
public static Task ExecuteNonQueryAsync(this IDatabaseConnector connector, string commandText, Func<int, Task> action)
Parameters
Type | Name | Description |
---|---|---|
IDatabaseConnector | connector | The database connector. |
System.String | commandText | The command text. |
Func<System.Int32, Task> | action | A callback action to process the affected rows quantity. |
Returns
Type | Description |
---|---|
Task |
ExecuteNonQueryAsync<T>(IDatabaseConnector, IDatabaseCommand, Func<Int32, T>)
Executes a database command as non query.
Declaration
public static Task<T> ExecuteNonQueryAsync<T>(this IDatabaseConnector connector, IDatabaseCommand command, Func<int, T> action)
Parameters
Type | Name | Description |
---|---|---|
IDatabaseConnector | connector | The database connector. |
IDatabaseCommand | command | The database command. |
Func<System.Int32, T> | action | A callback action to process the affected rows quantity. |
Returns
Type | Description |
---|---|
Task<T> |
Type Parameters
Name | Description |
---|---|
T |
ExecuteNonQueryAsync<T>(IDatabaseConnector, IDatabaseCommand, Func<Int32, Task<T>>)
Executes a database command as non query.
Declaration
public static Task<T> ExecuteNonQueryAsync<T>(this IDatabaseConnector connector, IDatabaseCommand command, Func<int, Task<T>> action)
Parameters
Type | Name | Description |
---|---|---|
IDatabaseConnector | connector | The database connector. |
IDatabaseCommand | command | The database command. |
Func<System.Int32, Task<T>> | action | A callback action to process the affected rows quantity. |
Returns
Type | Description |
---|---|
Task<T> |
Type Parameters
Name | Description |
---|---|
T |
ExecuteNonQueryAsync<T>(IDatabaseConnector, String, Func<Int32, T>)
Executes a database command as non query.
Declaration
public static Task<T> ExecuteNonQueryAsync<T>(this IDatabaseConnector connector, string commandText, Func<int, T> action)
Parameters
Type | Name | Description |
---|---|---|
IDatabaseConnector | connector | The database connector. |
System.String | commandText | The command text. |
Func<System.Int32, T> | action | A callback action to process the affected rows quantity. |
Returns
Type | Description |
---|---|
Task<T> |
Type Parameters
Name | Description |
---|---|
T |
ExecuteNonQueryAsync<T>(IDatabaseConnector, String, Func<Int32, Task<T>>)
Executes a database command as non query.
Declaration
public static Task<T> ExecuteNonQueryAsync<T>(this IDatabaseConnector connector, string commandText, Func<int, Task<T>> action)
Parameters
Type | Name | Description |
---|---|---|
IDatabaseConnector | connector | The database connector. |
System.String | commandText | The command text. |
Func<System.Int32, Task<T>> | action | A callback action to process the affected rows quantity. |
Returns
Type | Description |
---|---|
Task<T> |
Type Parameters
Name | Description |
---|---|
T |
ExecuteReader(IDatabaseConnector, IDatabaseCommand, Action<IDatabaseReader>)
Executes a database command as data reader.
Declaration
public static void ExecuteReader(this IDatabaseConnector connector, IDatabaseCommand command, Action<IDatabaseReader> action)
Parameters
Type | Name | Description |
---|---|---|
IDatabaseConnector | connector | The database connector. |
IDatabaseCommand | command | The database command. |
Action<IDatabaseReader> | action | A callback action to process the database reader. |
ExecuteReader(IDatabaseConnector, String, Action<IDatabaseReader>)
Executes a database command as data reader.
Declaration
public static void ExecuteReader(this IDatabaseConnector connector, string commandText, Action<IDatabaseReader> action)
Parameters
Type | Name | Description |
---|---|---|
IDatabaseConnector | connector | The database connector. |
System.String | commandText | The command text. |
Action<IDatabaseReader> | action | A callback action to process the database reader. |
ExecuteReader<T>(IDatabaseConnector, IDatabaseCommand, Func<IDatabaseReader, T>)
Executes a database command as data reader.
Declaration
public static T ExecuteReader<T>(this IDatabaseConnector connector, IDatabaseCommand command, Func<IDatabaseReader, T> action)
Parameters
Type | Name | Description |
---|---|---|
IDatabaseConnector | connector | The database connector. |
IDatabaseCommand | command | The database command. |
Func<IDatabaseReader, T> | action | A callback action to process the database reader. |
Returns
Type | Description |
---|---|
T |
Type Parameters
Name | Description |
---|---|
T |
ExecuteReader<T>(IDatabaseConnector, String, Func<IDatabaseReader, T>)
Executes a database command as data reader.
Declaration
public static T ExecuteReader<T>(this IDatabaseConnector connector, string commandText, Func<IDatabaseReader, T> action)
Parameters
Type | Name | Description |
---|---|---|
IDatabaseConnector | connector | The database connector. |
System.String | commandText | The command text. |
Func<IDatabaseReader, T> | action | A callback action to process the database reader. |
Returns
Type | Description |
---|---|
T |
Type Parameters
Name | Description |
---|---|
T |
ExecuteReaderAsync(IDatabaseConnector, IDatabaseCommand, Action<IDatabaseReader>)
Executes a database command as data reader.
Declaration
public static Task ExecuteReaderAsync(this IDatabaseConnector connector, IDatabaseCommand command, Action<IDatabaseReader> action)
Parameters
Type | Name | Description |
---|---|---|
IDatabaseConnector | connector | The database connector. |
IDatabaseCommand | command | The database command. |
Action<IDatabaseReader> | action | A callback action to process the database reader. |
Returns
Type | Description |
---|---|
Task |
ExecuteReaderAsync(IDatabaseConnector, IDatabaseCommand, Func<IDatabaseReader, Task>)
Executes a database command as data reader.
Declaration
public static Task ExecuteReaderAsync(this IDatabaseConnector connector, IDatabaseCommand command, Func<IDatabaseReader, Task> action)
Parameters
Type | Name | Description |
---|---|---|
IDatabaseConnector | connector | The database connector. |
IDatabaseCommand | command | The database command. |
Func<IDatabaseReader, Task> | action | A callback action to process the database reader. |
Returns
Type | Description |
---|---|
Task |
ExecuteReaderAsync(IDatabaseConnector, String, Action<IDatabaseReader>)
Executes a database command as data reader.
Declaration
public static Task ExecuteReaderAsync(this IDatabaseConnector connector, string commandText, Action<IDatabaseReader> action)
Parameters
Type | Name | Description |
---|---|---|
IDatabaseConnector | connector | The database connector. |
System.String | commandText | The command text. |
Action<IDatabaseReader> | action | A callback action to process the database reader. |
Returns
Type | Description |
---|---|
Task |
ExecuteReaderAsync(IDatabaseConnector, String, Func<IDatabaseReader, Task>)
Executes a database command as data reader.
Declaration
public static Task ExecuteReaderAsync(this IDatabaseConnector connector, string commandText, Func<IDatabaseReader, Task> action)
Parameters
Type | Name | Description |
---|---|---|
IDatabaseConnector | connector | The database connector. |
System.String | commandText | The command text. |
Func<IDatabaseReader, Task> | action | A callback action to process the database reader. |
Returns
Type | Description |
---|---|
Task |
ExecuteReaderAsync<T>(IDatabaseConnector, IDatabaseCommand, Func<IDatabaseReader, T>)
Executes a database command as data reader.
Declaration
public static Task<T> ExecuteReaderAsync<T>(this IDatabaseConnector connector, IDatabaseCommand command, Func<IDatabaseReader, T> action)
Parameters
Type | Name | Description |
---|---|---|
IDatabaseConnector | connector | The database connector. |
IDatabaseCommand | command | The database command. |
Func<IDatabaseReader, T> | action | A callback action to process the database reader. |
Returns
Type | Description |
---|---|
Task<T> |
Type Parameters
Name | Description |
---|---|
T |
ExecuteReaderAsync<T>(IDatabaseConnector, IDatabaseCommand, Func<IDatabaseReader, Task<T>>)
Executes a database command as data reader.
Declaration
public static Task<T> ExecuteReaderAsync<T>(this IDatabaseConnector connector, IDatabaseCommand command, Func<IDatabaseReader, Task<T>> action)
Parameters
Type | Name | Description |
---|---|---|
IDatabaseConnector | connector | The database connector. |
IDatabaseCommand | command | The database command. |
Func<IDatabaseReader, Task<T>> | action | A callback action to process the database reader. |
Returns
Type | Description |
---|---|
Task<T> |
Type Parameters
Name | Description |
---|---|
T |
ExecuteReaderAsync<T>(IDatabaseConnector, String, Func<IDatabaseReader, T>)
Executes a database command as data reader.
Declaration
public static Task<T> ExecuteReaderAsync<T>(this IDatabaseConnector connector, string commandText, Func<IDatabaseReader, T> action)
Parameters
Type | Name | Description |
---|---|---|
IDatabaseConnector | connector | The database connector. |
System.String | commandText | The command text. |
Func<IDatabaseReader, T> | action | A callback action to process the database reader. |
Returns
Type | Description |
---|---|
Task<T> |
Type Parameters
Name | Description |
---|---|
T |
ExecuteReaderAsync<T>(IDatabaseConnector, String, Func<IDatabaseReader, Task<T>>)
Executes a database command as data reader.
Declaration
public static Task<T> ExecuteReaderAsync<T>(this IDatabaseConnector connector, string commandText, Func<IDatabaseReader, Task<T>> action)
Parameters
Type | Name | Description |
---|---|---|
IDatabaseConnector | connector | The database connector. |
System.String | commandText | The command text. |
Func<IDatabaseReader, Task<T>> | action | A callback action to process the database reader. |
Returns
Type | Description |
---|---|
Task<T> |
Type Parameters
Name | Description |
---|---|
T |
ExecuteScalar(IDatabaseConnector, IDatabaseCommand, Action<Object>)
Executes a database command as scalar.
Declaration
public static void ExecuteScalar(this IDatabaseConnector connector, IDatabaseCommand command, Action<object> action)
Parameters
Type | Name | Description |
---|---|---|
IDatabaseConnector | connector | The database connector. |
IDatabaseCommand | command | The database command. |
Action<System.Object> | action | A callback action to process the scalar value. |
ExecuteScalar(IDatabaseConnector, String, Action<Object>)
Executes a database command as scalar.
Declaration
public static void ExecuteScalar(this IDatabaseConnector connector, string commandText, Action<object> action)
Parameters
Type | Name | Description |
---|---|---|
IDatabaseConnector | connector | The database connector. |
System.String | commandText | The database command. |
Action<System.Object> | action | A callback action to process the scalar value. |
ExecuteScalar<T>(IDatabaseConnector, IDatabaseCommand, Func<Object, T>)
Executes a database command as scalar.
Declaration
public static T ExecuteScalar<T>(this IDatabaseConnector connector, IDatabaseCommand command, Func<object, T> action)
Parameters
Type | Name | Description |
---|---|---|
IDatabaseConnector | connector | The database connector. |
IDatabaseCommand | command | The database command. |
Func<System.Object, T> | action | A callback action to process the scalar value. |
Returns
Type | Description |
---|---|
T |
Type Parameters
Name | Description |
---|---|
T |
ExecuteScalar<T>(IDatabaseConnector, String, Func<Object, T>)
Executes a database command as scalar.
Declaration
public static T ExecuteScalar<T>(this IDatabaseConnector connector, string commandText, Func<object, T> action)
Parameters
Type | Name | Description |
---|---|---|
IDatabaseConnector | connector | The database connector. |
System.String | commandText | The database command. |
Func<System.Object, T> | action | A callback action to process the scalar value. |
Returns
Type | Description |
---|---|
T |
Type Parameters
Name | Description |
---|---|
T |
ExecuteScalarAsync(IDatabaseConnector, IDatabaseCommand, Action<Object>)
Executes a database command as scalar.
Declaration
public static Task ExecuteScalarAsync(this IDatabaseConnector connector, IDatabaseCommand command, Action<object> action)
Parameters
Type | Name | Description |
---|---|---|
IDatabaseConnector | connector | The database connector. |
IDatabaseCommand | command | The database command. |
Action<System.Object> | action | A callback action to process the scalar value. |
Returns
Type | Description |
---|---|
Task |
ExecuteScalarAsync(IDatabaseConnector, IDatabaseCommand, Func<Object, Task>)
Executes a database command as scalar.
Declaration
public static Task ExecuteScalarAsync(this IDatabaseConnector connector, IDatabaseCommand command, Func<object, Task> action)
Parameters
Type | Name | Description |
---|---|---|
IDatabaseConnector | connector | The database connector. |
IDatabaseCommand | command | The database command. |
Func<System.Object, Task> | action | A callback action to process the scalar value. |
Returns
Type | Description |
---|---|
Task |
ExecuteScalarAsync(IDatabaseConnector, String, Action<Object>)
Executes a database command as scalar.
Declaration
public static Task ExecuteScalarAsync(this IDatabaseConnector connector, string commandText, Action<object> action)
Parameters
Type | Name | Description |
---|---|---|
IDatabaseConnector | connector | The database connector. |
System.String | commandText | The database command. |
Action<System.Object> | action | A callback action to process the scalar value. |
Returns
Type | Description |
---|---|
Task |
ExecuteScalarAsync(IDatabaseConnector, String, Func<Object, Task>)
Executes a database command as scalar.
Declaration
public static Task ExecuteScalarAsync(this IDatabaseConnector connector, string commandText, Func<object, Task> action)
Parameters
Type | Name | Description |
---|---|---|
IDatabaseConnector | connector | The database connector. |
System.String | commandText | The database command. |
Func<System.Object, Task> | action | A callback action to process the scalar value. |
Returns
Type | Description |
---|---|
Task |
ExecuteScalarAsync<T>(IDatabaseConnector, IDatabaseCommand, Func<Object, Task<T>>)
Executes a database command as scalar.
Declaration
public static Task<T> ExecuteScalarAsync<T>(this IDatabaseConnector connector, IDatabaseCommand command, Func<object, Task<T>> action)
Parameters
Type | Name | Description |
---|---|---|
IDatabaseConnector | connector | The database connector. |
IDatabaseCommand | command | The database command. |
Func<System.Object, Task<T>> | action | A callback action to process the scalar value. |
Returns
Type | Description |
---|---|
Task<T> |
Type Parameters
Name | Description |
---|---|
T |
ExecuteScalarAsync<T>(IDatabaseConnector, String, Func<Object, Task<T>>)
Executes a database command as scalar.
Declaration
public static Task<T> ExecuteScalarAsync<T>(this IDatabaseConnector connector, string commandText, Func<object, Task<T>> action)
Parameters
Type | Name | Description |
---|---|---|
IDatabaseConnector | connector | The database connector. |
System.String | commandText | The database command. |
Func<System.Object, Task<T>> | action | A callback action to process the scalar value. |
Returns
Type | Description |
---|---|
Task<T> |
Type Parameters
Name | Description |
---|---|
T |
Query<TResultType>(IDatabaseConnector, String, Object[])
Executes a query and return the results.
Declaration
public static List<TResultType> Query<TResultType>(this IDatabaseConnector connector, string whereClause = null, params object[] parameters)where TResultType : class
Parameters
Type | Name | Description |
---|---|---|
IDatabaseConnector | connector | The database connector. |
System.String | whereClause | A where filter clause. Do not add the "WHERE" keyword to it. If you need to pass parameters, pass using @1, @2, @3. |
System.Object[] | parameters | A list of parameter values. |
Returns
Type | Description |
---|---|
List<TResultType> | A list of |
Type Parameters
Name | Description |
---|---|
TResultType | The result type. |
See Also
QueryAsync<TResultType>(IDatabaseConnector, String, Object[])
Executes a query and return the results.
Declaration
public static Task<List<TResultType>> QueryAsync<TResultType>(this IDatabaseConnector connector, string whereClause = null, params object[] parameters)where TResultType : class
Parameters
Type | Name | Description |
---|---|---|
IDatabaseConnector | connector | The database connector. |
System.String | whereClause | A where filter clause. Do not add the "WHERE" keyword to it. If you need to pass parameters, pass using @1, @2, @3. |
System.Object[] | parameters | A list of parameter values. |
Returns
Type | Description |
---|---|
Task<List<TResultType>> | A list of |
Type Parameters
Name | Description |
---|---|
TResultType | The result type. |