Search Results for

    Show / Hide Table of Contents

    Interface IApplicationDbContext

    The application's DbContext

    Inherited Members
    IDisposable.Dispose()
    IAsyncDisposable.DisposeAsync()
    Namespace: LemonEdge.DataAccess.Core.Abstractions.EntityFramework
    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
    Type Description
    IDbTransaction

    Methods

    BeginTransactionAsync(CancellationToken)

    Asynchronously starts a new transaction.

    Declaration
    Task<IDbContextTransaction> BeginTransactionAsync(CancellationToken token = default)
    Parameters
    Type Name Description
    CancellationToken token
    Returns
    Type Description
    Task<IDbContextTransaction>

    GetCommandTimeout()

    Returns the timeout (in seconds) set for commands executed with this context

    Declaration
    int? GetCommandTimeout()
    Returns
    Type Description
    int?

    GetCurrentTransaction()

    Gets the current transaction being used by the context, or null if no transaction is in use

    Declaration
    IDbTransaction GetCurrentTransaction()
    Returns
    Type Description
    IDbTransaction

    GetDbConnection()

    Gets the underlying ADO.NET connection for this context

    Declaration
    IDbConnection GetDbConnection()
    Returns
    Type Description
    IDbConnection

    GetExecutionStrategy()

    Creates an instance of the configured IExecutionStrategy

    Declaration
    IExecutionStrategy GetExecutionStrategy()
    Returns
    Type Description
    IExecutionStrategy

    GetSet<T>()

    Retrieves a DbSet<TEntity> from the underlying IDbConnection

    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
    Type Name Description
    CancellationToken token
    Returns
    Type Description
    Task

    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
    Type Name Description
    IDbTransaction dbTransaction

    Extension Methods

    LinqExtensions.AsArray<T>(T)
    LinqExtensions.ToArrayOfOne<T>(T)
    LinqExtensions.ToListOfOne<T>(T)
    MiscExtensions.SetIfNotEqual<T, TP>(T, Expression<Func<T, TP>>, TP)
    WeakReferenceExtensions.WeakReference(object)
    SQLExtensions.ToSQLValue(object, bool)
    ReflectionExtensions.ClearEventInvocations(object, string)
    StringExtensions.ToCSVFormatString(object, Type)
    In this article
    Back to top © LemonEdge Technologies. All rights reserved.