Sphyrnidae Common Library  2.0.1
Shared Utilities/Library
Sphyrnidae.Common.Dal.SqlServerRepo Class Reference

Use this class to talk to a Sql Server database More...

Inheritance diagram for Sphyrnidae.Common.Dal.SqlServerRepo:
Sphyrnidae.Common.Dal.BaseRepo Sphyrnidae.Common.DynamicSql.DynamicSqlServerRepo

Protected Member Functions

 SqlServerRepo (ILogger logger)
 
override Task PreCall (IDbConnection cnn, IDbTransaction trans)
 If you need to execute something before the main call More...
 
- Protected Member Functions inherited from Sphyrnidae.Common.Dal.BaseRepo
virtual Task PostCall (IDbConnection cnn, IDbTransaction trans)
 If you need to execute something after the main call More...
 
 BaseRepo (ILogger logger)
 
Task< int > WriteSQLAsync (string sql, object parameters, IDbTransaction trans=null)
 Executes something against a database More...
 
Task< int > WriteSPAsync (string sp, object parameters, IDbTransaction trans=null)
 Executes something against a database More...
 
async Task< bool > WriteSQLAsBoolAsync (string sql, object parameters, IDbTransaction trans=null)
 Executes something against a database More...
 
async Task< bool > WriteSPAsBoolAsync (string sp, object parameters, IDbTransaction trans=null)
 Executes something against a database More...
 
Task< int?> WriteSQLTrappingExceptionsAsync (string sql, object parameters, IDbTransaction trans=null)
 Executes something against a database More...
 
Task< int?> WriteSPTrappingExceptionsAsync (string sp, object parameters, IDbTransaction trans=null)
 Executes something against a database More...
 
async Task< bool?> WriteSQLAsBoolTrappingExceptionsAsync (string sql, object parameters, IDbTransaction trans=null)
 Executes something against a database More...
 
async Task< bool?> WriteSPAsBoolTrappingExceptionsAsync (string sp, object parameters, IDbTransaction trans=null)
 Executes something against a database More...
 
Task< T > ScalarSQLAsync< T > (string sql, object parameters, IDbTransaction trans=null)
 Executes something against a database that returns a single result More...
 
Task< T > ScalarSPAsync< T > (string sp, object parameters, IDbTransaction trans=null)
 Executes something against a database that returns a single result More...
 
Task< T > ScalarSQLTrappingExceptionsAsync< T > (string sql, object parameters, IDbTransaction trans=null)
 Executes something against a database that returns a single result More...
 
Task< T > ScalarSPTrappingExceptionsAsync< T > (string sp, object parameters, IDbTransaction trans=null)
 Executes something against a database that returns a single result More...
 
Task< int?> InsertAsync (string sql, object parameters, IDbTransaction trans=null)
 Inserts a record into the database More...
 
Task< int?> InsertTrappingExceptionsAsync (string sql, object parameters, IDbTransaction trans=null)
 Inserts a record into the database More...
 
Task< int?> InsertAsync (string sql, DatabaseIdentity identity, object parameters, IDbTransaction trans=null, bool trapExceptions=false)
 Inserts a record into the database More...
 
Task< T > GetSQLAsync< T > (string sql, object parameters, IDbTransaction trans=null)
 Retrieves a single record from the database More...
 
Task< T > GetSPAsync< T > (string sp, object parameters, IDbTransaction trans=null)
 Retrieves a single record from the database More...
 
Task< IEnumerable< T > > GetListSQLAsync< T > (string sql, object parameters, IDbTransaction trans=null)
 Retrieves multiple records (0, 1, or more) from the database More...
 
Task< IEnumerable< T > > GetListSPAsync< T > (string sp, object parameters, IDbTransaction trans=null)
 Retrieves multiple records (0, 1, or more) from the database More...
 
Task< bool > ExistsAsync (string conditions, object parameters, IDbTransaction trans=null)
 Does an existence check against the database More...
 

Properties

override IDbConnection GetConnection [get]
 
- Properties inherited from Sphyrnidae.Common.Dal.BaseRepo
abstract string CnnStr [get]
 The actual connection string More...
 
abstract string CnnName [get]
 Nice name of the database connection (eg. web.config key) used for logging More...
 
abstract IDbConnection GetConnection [get]
 The actual connection to the database More...
 
virtual bool DoLog [get]
 For use with database logger: Set to false so that it won't recursively log the log call More...
 
ILogger Logger [get]
 Implementation of the ILogger interface More...
 

Additional Inherited Members

- Public Member Functions inherited from Sphyrnidae.Common.Dal.BaseRepo
virtual ApiResponseStandard HandleException ()
 If an exception was trapped, this will provide access to the trapped exception for proper responses More...
 
- Static Protected Member Functions inherited from Sphyrnidae.Common.Dal.BaseRepo
static string ExistsCondition (string fromTableAndWhere)
 Use this to add a "condition" to be used in "Exists" check More...
 
- Protected Attributes inherited from Sphyrnidae.Common.Dal.BaseRepo
Exception Ex
 The trapped exception More...
 

Detailed Description

Use this class to talk to a Sql Server database

Constructor & Destructor Documentation

◆ SqlServerRepo()

Sphyrnidae.Common.Dal.SqlServerRepo.SqlServerRepo ( ILogger  logger)
protected

Member Function Documentation

◆ PreCall()

override Task Sphyrnidae.Common.Dal.SqlServerRepo.PreCall ( IDbConnection  cnn,
IDbTransaction  trans 
)
protectedvirtual

If you need to execute something before the main call

Reimplemented from Sphyrnidae.Common.Dal.BaseRepo.

Property Documentation

◆ GetConnection

override IDbConnection Sphyrnidae.Common.Dal.SqlServerRepo.GetConnection
getprotected

The documentation for this class was generated from the following file: