MigrateDatabaseToLatestVersion<TContext, TMigrationsConfiguration> Class
An implementation of IDatabaseInitializer<TContext> that will use Code First Migrations to update the database to the latest version.
Assembly: EntityFramework (in EntityFramework.dll)
public class MigrateDatabaseToLatestVersion<TContext, TMigrationsConfiguration> : IDatabaseInitializer<TContext> where TContext : DbContext where TMigrationsConfiguration : new(), DbMigrationsConfiguration<TContext>
Type Parameters
- TContext
The type of the context.
- TMigrationsConfiguration
The type of the migrations configuration to use during initialization.
Name | Description | |
---|---|---|
![]() | MigrateDatabaseToLatestVersion<TContext, TMigrationsConfiguration>() | Initializes a new instance of the MigrateDatabaseToLatestVersion class that will use the connection information from a context constructed using the default constructor or registered factory if applicable |
![]() | MigrateDatabaseToLatestVersion<TContext, TMigrationsConfiguration>(Boolean) | Initializes a new instance of the MigrateDatabaseToLatestVersion class specifying whether to use the connection information from the context that triggered initialization to perform the migration. |
![]() | MigrateDatabaseToLatestVersion<TContext, TMigrationsConfiguration>(Boolean, TMigrationsConfiguration) | Initializes a new instance of the MigrateDatabaseToLatestVersion class specifying whether to use the connection information from the context that triggered initialization to perform the migration. Also allows specifying migrations configuration to use during initialization. |
![]() | MigrateDatabaseToLatestVersion<TContext, TMigrationsConfiguration>(String) | Initializes a new instance of the MigrateDatabaseToLatestVersion class that will use a specific connection string from the configuration file to connect to the database to perform the migration. |
Name | Description | |
---|---|---|
![]() | Equals(Object) | (Inherited from Object.) |
![]() | Finalize() | (Inherited from Object.) |
![]() | GetHashCode() | (Inherited from Object.) |
![]() | GetType() | (Inherited from Object.) |
![]() | InitializeDatabase(TContext) | Initializes the database for the given context. |
![]() | MemberwiseClone() | (Inherited from Object.) |
![]() | ToString() | (Inherited from Object.) |
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.