Interface IDatabaseGateway
Executes SQL statements against a database. Implement this to plug in a data access library other than Dapper.
Namespace: Activout.DatabaseClient
Assembly: Activout.DatabaseClient.dll
Syntax
public interface IDatabaseGateway
Methods
| Edit this page View SourceBeginTransaction(IsolationLevel)
Begins a transaction.
Declaration
IDbTransaction BeginTransaction(IsolationLevel isolationLevel)
Parameters
| Type | Name | Description |
|---|---|---|
| IsolationLevel | isolationLevel | The isolation level. |
Returns
| Type | Description |
|---|---|
| IDbTransaction | The transaction. |
ExecuteAsync(SqlStatement)
Executes a statement that does not return rows.
Declaration
Task<int> ExecuteAsync(SqlStatement statement)
Parameters
| Type | Name | Description |
|---|---|---|
| SqlStatement | statement | The statement. |
Returns
| Type | Description |
|---|---|
| Task<int> | The number of affected rows. |
QueryAsync(SqlStatement)
Runs a query and maps all rows to EffectiveType.
Declaration
Task<IEnumerable<object>> QueryAsync(SqlStatement statement)
Parameters
| Type | Name | Description |
|---|---|---|
| SqlStatement | statement | The statement. |
Returns
| Type | Description |
|---|---|
| Task<IEnumerable<object>> | The mapped rows. |
QueryFirstOrDefaultAsync(SqlStatement)
Runs a query and maps the first row to EffectiveType.
Declaration
Task<object?> QueryFirstOrDefaultAsync(SqlStatement statement)
Parameters
| Type | Name | Description |
|---|---|---|
| SqlStatement | statement | The statement. |
Returns
| Type | Description |
|---|---|
| Task<object> | The mapped row, or |