Utilities for using AdaptiveClient to work with DBContext and migrations.
Get the Nuget package
2024-11-29 v5 - Migrate to .net 9 / EF 9.
2022-12-27 v4 - Migrate to .net 7 / EF 7.
2021-02-07 v2.0.0 - Migrate to .net 5. Drop support for .net framework. Update Entity Framework dependencies to EF Core 5.
- Use an
IEndPointConfiguration
to resolve aDbContext
. Check status of resolvedDbContext
or perform other operations such as applying migrations or dropping the database.
- Returns names of applied migrations, if any, and if database was created.
- Enum that provides status of a given database: Unknown, DoesNotExist, NotConsistentWithModel, ConsistentWithModel.
- Methods for resolving and working with DbContext. See
DatabaseUtilities
implementation.
- Method for seeding a database when it is created or when a migration is applied.
- An interface for keying DbContextOptions.
- A placeholder interface for keying a MigrationContext
- RegisterDbContext - Keys a class derived from
DbContext
to an API_Name. - RegisterDbContextOptions - Keys a class that implements IDbContextOptions to a specific provider such as MSSQL or MySQL.
- RegisterMigrationContext - Allows EntityFramework to reflect on an assembly and resolve a DbContext to a specific provider such as MSSQL or MySQL.
- RegisterDatabaseInitializer - Keys a class that provides initialization services such as seeding a newly created database.
- ResolveDbContext - Resolves a
DbContext
instance using keys provided by aIEndPointConfiguration
parameter. - ResolveDbContextOptions - Resolves an instance of
DbContextOptions
using keys provided by aIEndPointConfiguration
parameter. - ResolveMigrationContext - Resolves an implementation of
IMigrationContext
using keys provided by aIEndPointConfiguration
parameter. - ResolveDatabaseInitializer - Resolves an implementation of
IDatabaseInitalizer
using keys provided by aIEndPointConfiguration
parameter.