Skip to main content
All docs
V25.2
  • 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.2.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