Class ConnectionContext
Helper class that wraps a connection and a transaction.
Inheritance
System.Object
ConnectionContext
Assembly: EPiServer.Data.dll
Version: 12.0.3
Syntax
public class ConnectionContext : Object, IAsyncConnectionContext, IConnectionContext
Constructors
ConnectionContext(DbProviderFactory, ConnectionStringOptions, RetryPolicy)
Declaration
public ConnectionContext(DbProviderFactory factory, ConnectionStringOptions connectionStringOption, RetryPolicy retryPolicy)
Parameters
Properties
Connection
Declaration
public DbConnection Connection { get; set; }
Property Value
Type |
Description |
System.Data.Common.DbConnection |
|
IsActive
Determines if there is an active connection on this context
Declaration
public bool IsActive { get; }
Property Value
Type |
Description |
System.Boolean |
|
IsInTransaction
Declaration
public virtual bool IsInTransaction { get; }
Property Value
Type |
Description |
System.Boolean |
|
Transaction
Declaration
public DbTransaction Transaction { get; set; }
Property Value
Type |
Description |
System.Data.Common.DbTransaction |
|
Methods
BeginTransaction()
Declaration
public virtual void BeginTransaction()
CloseConnection()
Declaration
public void CloseConnection()
CommitTransaction()
Declaration
public virtual void CommitTransaction()
OpenConnection()
Open a connection to the database
Declaration
public void OpenConnection()
OpenConnectionAsync()
Declaration
public virtual Task OpenConnectionAsync()
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
RollbackTransaction()
Declaration
public virtual void RollbackTransaction()
Implements
Extension Methods