View Source
Class UmbracoDatabase
Extends NPoco Database for Umbraco.
Inheritance
System.Object
Assembly: Umbraco.Core.dll
Syntax
public class UmbracoDatabase : Database, IUmbracoDatabase
Constructors
View Source
UmbracoDatabase(String, ISqlContext, DbProviderFactory, ILogger, RetryPolicy, RetryPolicy)
Declaration
public UmbracoDatabase(string connectionString, ISqlContext sqlContext, DbProviderFactory provider, ILogger logger, RetryPolicy connectionRetryPolicy = null, RetryPolicy commandRetryPolicy = null)
Parameters
Type |
Name |
Description |
System.String |
connectionString |
|
ISqlContext |
sqlContext |
|
System.Data.Common.DbProviderFactory |
provider |
|
ILogger |
logger |
|
RetryPolicy |
connectionRetryPolicy |
|
RetryPolicy |
commandRetryPolicy |
|
Remarks
Properties
View Source
InstanceId
Gets the database instance unique identifier as a string.
Declaration
public string InstanceId { get; }
Property Value
Type |
Description |
System.String |
|
View Source
InTransaction
Gets a value indicating whether the database is currently in a transaction.
Declaration
public bool InTransaction { get; }
Property Value
Type |
Description |
System.Boolean |
|
View Source
SqlContext
Declaration
public ISqlContext SqlContext { get; }
Property Value
Methods
View Source
CreateCommand(DbConnection, CommandType, String, Object[])
Declaration
public override DbCommand CreateCommand(DbConnection connection, CommandType commandType, string sql, params object[] args)
Parameters
Type |
Name |
Description |
System.Data.Common.DbConnection |
connection |
|
System.Data.CommandType |
commandType |
|
System.String |
sql |
|
System.Object[] |
args |
|
Returns
Type |
Description |
System.Data.Common.DbCommand |
|
View Source
OnAbortTransaction()
Declaration
protected override void OnAbortTransaction()
View Source
OnBeginTransaction()
Declaration
protected override void OnBeginTransaction()
View Source
OnCompleteTransaction()
Declaration
protected override void OnCompleteTransaction()
View Source
OnConnectionOpened(DbConnection)
Declaration
protected override DbConnection OnConnectionOpened(DbConnection connection)
Parameters
Type |
Name |
Description |
System.Data.Common.DbConnection |
connection |
|
Returns
Type |
Description |
System.Data.Common.DbConnection |
|
View Source
OnException(Exception)
Declaration
protected override void OnException(Exception ex)
Parameters
Type |
Name |
Description |
System.Exception |
ex |
|
View Source
OnExecutedCommand(DbCommand)
Declaration
protected override void OnExecutedCommand(DbCommand cmd)
Parameters
Type |
Name |
Description |
System.Data.Common.DbCommand |
cmd |
|
View Source
OnExecutingCommand(DbCommand)
Declaration
protected override void OnExecutingCommand(DbCommand cmd)
Parameters
Type |
Name |
Description |
System.Data.Common.DbCommand |
cmd |
|