Sphyrnidae Common Library
2.0.1
Shared Utilities/Library
|
Database Transactions More...
Static Public Member Functions | |
static Task< T > | Distributed< T > (ILogger logger, Func< Task< TransactionResponse< T >>> method) |
Wrapper for multiple Sql calls across multiple databases within a transaction More... | |
static Task< T > | Distributed< T > (ILogger logger, Func< Task< TransactionResponse< T >>> method, T defaultValue) |
Wrapper for multiple Sql calls across multiple databases within a transaction More... | |
static async Task< T > | Distributed< T > (ILogger logger, Func< Task< TransactionResponse< T >>> method, Func< Exception, T, T > exceptionMethod, T defaultValue=default) |
Wrapper for multiple Sql calls across multiple databases within a transaction More... | |
static Task< T > | Run< T > (ILogger logger, string cnnStr, Func< IDbTransaction, Task< TransactionResponse< T >>> method) |
Wrapper for multiple Sql calls (Single database) within a transaction More... | |
static Task< T > | Run< T > (ILogger logger, string cnnStr, Func< IDbTransaction, Task< TransactionResponse< T >>> method, T defaultValue) |
Wrapper for multiple Sql calls (Single database) within a transaction More... | |
static Task< T > | Run< T > (ILogger logger, string cnnStr, Func< IDbTransaction, Task< TransactionResponse< T >>> method, IsolationLevel isolation) |
Wrapper for multiple Sql calls (Single database) within a transaction More... | |
static Task< T > | Run< T > (ILogger logger, string cnnStr, Func< IDbTransaction, Task< TransactionResponse< T >>> method, IsolationLevel isolation, T defaultValue) |
Wrapper for multiple Sql calls (Single database) within a transaction More... | |
static Task< T > | Run< T > (ILogger logger, string cnnStr, Func< IDbTransaction, Task< TransactionResponse< T >>> method, Func< Exception, T, T > exceptionMethod, T defaultValue=default) |
Wrapper for multiple Sql calls (Single database) within a transaction More... | |
static async Task< T > | Run< T > (ILogger logger, string cnnStr, Func< IDbTransaction, Task< TransactionResponse< T >>> method, IsolationLevel isolation, Func< Exception, T, T > exceptionMethod, T defaultValue=default) |
Wrapper for multiple Sql calls (Single database) within a transaction More... | |
static async Task< bool > | Distributed (ILogger logger, Func< Task< TransactionResponse >> method, Func< Exception, bool > exceptionMethod=null) |
Wrapper for multiple Sql calls across multiple databases within a transaction More... | |
static Task< bool > | Run (ILogger logger, string cnnStr, Func< IDbTransaction, Task< TransactionResponse >> method, Func< Exception, bool > exceptionMethod=null) |
Wrapper for multiple Sql calls (Single database) within a transaction More... | |
static Task< bool > | Run (ILogger logger, string cnnStr, Func< IDbTransaction, Task< TransactionResponse >> method, IsolationLevel isolation) |
Wrapper for multiple Sql calls (Single database) within a transaction More... | |
static async Task< bool > | Run (ILogger logger, string cnnStr, Func< IDbTransaction, Task< TransactionResponse >> method, IsolationLevel isolation, Func< Exception, bool > exceptionMethod) |
Wrapper for multiple Sql calls (Single database) within a transaction More... | |
static bool | ExceptionRethrow (Exception ex) |
Use this method as parameter for Sql().exceptionMethod More... | |
static T | ExceptionDefaultVal< T > (Exception ex, T defaultValue) |
Use this method as parameter for Sql().exceptionMethod More... | |
static T | ExceptionRethrow< T > (Exception ex, T defaultValue) |
Use this method as parameter for Sql().exceptionMethod More... | |
Database Transactions
TC | : | DbConnection | |
TC | : | new() |
|
static |
Wrapper for multiple Sql calls across multiple databases within a transaction
This will use individual connections using a distributed transactions (performance hit)
logger | The logger for the transaction sequence |
method | The actual SQL calls |
exceptionMethod | Default = ExceptionRethrow. If an exception is thrown during "method", how will it be handled (besides being rolled back) |
|
static |
Wrapper for multiple Sql calls across multiple databases within a transaction
This will use individual connections using a distributed transactions (performance hit)
T | Return type of the complete transaction |
logger | The logger for the transaction sequence |
method | The actual SQL calls |
|
static |
Wrapper for multiple Sql calls across multiple databases within a transaction
This will use individual connections using a distributed transactions (performance hit)
T | Return type of the complete transaction |
logger | The logger for the transaction sequence |
method | The actual SQL calls |
exceptionMethod | Default = ExceptionRethrow. If an exception is thrown during "method", how will it be handled (besides being rolled back) |
defaultValue | Default = Default(T). If an exception is thrown during "method", and it is not rethrowing the exception, this will instead be returned |
|
static |
Wrapper for multiple Sql calls across multiple databases within a transaction
This will use individual connections using a distributed transactions (performance hit)
T | Return type of the complete transaction |
logger | The logger for the transaction sequence |
method | The actual SQL calls |
defaultValue | Default = Default(T). If an exception is thrown during "method", and it is not rethrowing the exception, this will instead be returned |
|
static |
Use this method as parameter for Sql().exceptionMethod
T | Return type |
ex | Exception that was thrown |
defaultValue | The default return value |
|
static |
Use this method as parameter for Sql().exceptionMethod
ex | Exception that was thrown |
|
static |
Use this method as parameter for Sql().exceptionMethod
T | Return type (unused) |
ex | Exception that was thrown |
defaultValue | The default return value (unused) |
|
static |
Wrapper for multiple Sql calls (Single database) within a transaction
logger | The logger for the transaction sequence |
cnnStr | The connection string to use for all calls within the transaction |
method | The actual SQL calls |
exceptionMethod | Default = ExceptionRethrow. If an exception is thrown during "method", how will it be handled (besides being rolled back) |
|
static |
Wrapper for multiple Sql calls (Single database) within a transaction
logger | The logger for the transaction sequence |
cnnStr | The connection string to use for all calls within the transaction |
method | The actual SQL calls |
isolation | Default = ReadCommitted. Isolation level for the transaction. |
|
static |
Wrapper for multiple Sql calls (Single database) within a transaction
logger | The logger for the transaction sequence |
cnnStr | The connection string to use for all calls within the transaction |
method | The actual SQL calls |
isolation | Default = ReadCommitted. Isolation level for the transaction. |
exceptionMethod | Default = ExceptionRethrow. If an exception is thrown during "method", how will it be handled (besides being rolled back) |
|
static |
Wrapper for multiple Sql calls (Single database) within a transaction
T | Return type of the complete transaction |
logger | The logger for the transaction sequence |
cnnStr | The connection string to use for all calls within the transaction |
method | The actual SQL calls |
|
static |
Wrapper for multiple Sql calls (Single database) within a transaction
T | Return type of the complete transaction |
logger | The logger for the transaction sequence |
cnnStr | The connection string to use for all calls within the transaction |
method | The actual SQL calls |
exceptionMethod | Default = ExceptionRethrow. If an exception is thrown during "method", how will it be handled (besides being rolled back) |
defaultValue | Default = Default(T). If an exception is thrown during "method", and it is not rethrowing the exception, this will instead be returned |
|
static |
Wrapper for multiple Sql calls (Single database) within a transaction
T | Return type of the complete transaction |
logger | The logger for the transaction sequence |
cnnStr | The connection string to use for all calls within the transaction |
method | The actual SQL calls |
isolation | Default = ReadCommitted. Isolation level for the transaction. |
|
static |
Wrapper for multiple Sql calls (Single database) within a transaction
T | Return type of the complete transaction |
logger | The logger for the transaction sequence |
cnnStr | The connection string to use for all calls within the transaction |
method | The actual SQL calls |
isolation | Default = ReadCommitted. Isolation level for the transaction. |
exceptionMethod | Default = ExceptionRethrow. If an exception is thrown during "method", how will it be handled (besides being rolled back) |
defaultValue | Default = Default(T). If an exception is thrown during "method", and it is not rethrowing the exception, this will instead be returned |
|
static |
Wrapper for multiple Sql calls (Single database) within a transaction
T | Return type of the complete transaction |
logger | The logger for the transaction sequence |
cnnStr | The connection string to use for all calls within the transaction |
method | The actual SQL calls |
isolation | Default = ReadCommitted. Isolation level for the transaction. |
defaultValue | Default = Default(T). If an exception is thrown during "method", and it is not rethrowing the exception, this will instead be returned |
|
static |
Wrapper for multiple Sql calls (Single database) within a transaction
T | Return type of the complete transaction |
logger | The logger for the transaction sequence |
cnnStr | The connection string to use for all calls within the transaction |
method | The actual SQL calls |
defaultValue | Default = Default(T). If an exception is thrown during "method", and it is not rethrowing the exception, this will instead be returned |