DbContextBuilder<TContext>.WithDbContext<TDbContext>(Action<XafApplication, DbContextOptionsBuilder>, ServiceLifetime) Method
Allows you to configure specified DbContext
.
Namespace: DevExpress.ExpressApp.ApplicationBuilder
Assembly: DevExpress.ExpressApp.EFCore.v25.1.dll
NuGet Package: DevExpress.ExpressApp.EFCore
Declaration
public IObjectSpaceProviderBuilder<TContext> WithDbContext<TDbContext>(
Action<XafApplication, DbContextOptionsBuilder> configureOptions,
ServiceLifetime dbContextFactoryServiceLifetime = ServiceLifetime.Scoped
)
where TDbContext : DbContext
Parameters
Name | Type | Description |
---|---|---|
configureOptions | Action<XafApplication, DbContextOptionsBuilder> | A delegate that configures |
Optional Parameters
Name | Type | Default | Description |
---|---|---|---|
dbContextFactoryServiceLifetime | ServiceLifetime | Scoped | A ServiceLifetime enumeration value that specifies the lifetime of the |
Type Parameters
Name | Description |
---|---|
TDbContext | The type of a |
Returns
Type | Description |
---|---|
IObjectSpaceProviderBuilder<TContext> | Allows you to register and configure Object Space Providers in your application, and chain further provider registrations. |
See Also