Interface ICreateDbContext
Defines the contract for creating instances of DbContext.
Namespace: Wolfgang.DbContextBuilderCore
Assembly: Wolfgang.DbContextBuilder-Core.dll
Syntax
public interface ICreateDbContext
Methods
| Edit this page View SourceCreateDbContextAsync<TDbContext>(DbContextOptionsBuilder<TDbContext>)
Creates a new instance of the specified TDbContext type.
Declaration
Task<TDbContext> CreateDbContextAsync<TDbContext>(DbContextOptionsBuilder<TDbContext> optionsBuilder) where TDbContext : DbContext
Parameters
| Type | Name | Description |
|---|---|---|
| DbContextOptionsBuilder<TDbContext> | optionsBuilder | The options builder used to configure the DbContext. |
Returns
| Type | Description |
|---|---|
| Task<TDbContext> | A task that resolves to a new instance of |
Type Parameters
| Name | Description |
|---|---|
| TDbContext | The type of DbContext to create. |