Skip to main content
All docs
V25.1
  • .NET 8.0+
    • The page you are viewing does not exist in the .NET Framework 4.6.2+ platform documentation. This link will take you to the parent topic of the current section.

    IMultiTenancyApplicationBuilder.WithHostDbContext(Action<IServiceProvider, DbContextOptionsBuilder>, Boolean, Boolean, Boolean) Method

    Configures DbContext used by the application to access the host database containing tenant settings.

    Namespace: DevExpress.ExpressApp.MultiTenancy.EFCore

    Assembly: DevExpress.ExpressApp.MultiTenancy.EFCore.v25.1.dll

    NuGet Package: DevExpress.ExpressApp.MultiTenancy.EFCore

    Declaration

    IMultiTenancyApplicationBuilder WithHostDbContext(
        Action<IServiceProvider, DbContextOptionsBuilder> configureServiceDbContext,
        bool isMiddleTier = false,
        bool enableOptimisticLock = true,
        bool enableDeferredDeletion = true
    )

    Parameters

    Name Type Description
    configureServiceDbContext Action<IServiceProvider, DbContextOptionsBuilder>

    A delegate that configures DbContext.

    Optional Parameters

    Name Type Default Description
    isMiddleTier Boolean False

    true if the application uses the Middle Tier Security; otherwise, false.

    enableOptimisticLock Boolean True

    true to enable Optimistic Locking; otherwise, false.

    enableDeferredDeletion Boolean True

    true to enable Soft Deletion (Deferred Object Deletion); otherwise, false.

    Returns

    Type Description
    IMultiTenancyApplicationBuilder

    The application builder that processed the action.

    See Also