Interface IApplicationDbContext
Assembly: LemonEdge.DataAccess.Core.Abstractions.dll
Syntax
public interface IApplicationDbContext : IDisposable, IAsyncDisposable
Properties
Transaction
Gets the current transaction being used by the context, or null if no transaction is in use
Declaration
IDbTransaction Transaction { get; }
Property Value
Methods
BeginTransactionAsync(CancellationToken)
Asynchronously starts a new transaction.
Declaration
Task<IDbContextTransaction> BeginTransactionAsync(CancellationToken token = default)
Parameters
Returns
GetCommandTimeout()
Returns the timeout (in seconds) set for commands executed with this context
Declaration
Returns
GetCurrentTransaction()
Gets the current transaction being used by the context, or null if no transaction is in use
Declaration
IDbTransaction GetCurrentTransaction()
Returns
GetDbConnection()
Gets the underlying ADO.NET connection for this context
Declaration
IDbConnection GetDbConnection()
Returns
GetExecutionStrategy()
Declaration
IExecutionStrategy GetExecutionStrategy()
Returns
GetSet<T>()
Declaration
DbSet<T>? GetSet<T>() where T : class
Returns
Type |
Description |
DbSet<T> |
|
Type Parameters
Name |
Description |
T |
The entity type registered against the model
|
OpenConnectionAsync(CancellationToken)
Asynchronously opens the underlying connection
Declaration
Task OpenConnectionAsync(CancellationToken token = default)
Parameters
Returns
SetCommandTimeout(int?)
Sets the timeout (in seconds) to use for commands executed with this context.
Declaration
void SetCommandTimeout(int? timeout)
Parameters
Type |
Name |
Description |
int? |
timeout |
|
UseTransaction(IDbTransaction)
Sets the transaction to be used by database operations on the context
Declaration
void UseTransaction(IDbTransaction dbTransaction)
Parameters
Extension Methods