DropCreateDatabaseIfModelChanges<TContext> Class
Entity Framework
An implementation of IDatabaseInitializer<TContext>that will delete, recreate, and optionally re-seed the database with data only if the model has changed since the database was created. This is achieved by writing a hash of the store model to the database when it is created and then comparing that hash with one generated from the current model. To seed the database, create a derived class and override the Seed method.
Namespace: System.Data.Entity
Assembly: EntityFramework (in EntityFramework.dll)
The DropCreateDatabaseIfModelChanges<TContext> type exposes the following members.
| Name | Description | |
|---|---|---|
|
DropCreateDatabaseIfModelChanges<TContext> | Initializes a new instance of the DropCreateDatabaseIfModelChanges<TContext> class. |
| Name | Description | |
|---|---|---|
|
Equals | (Inherited from Object.) |
|
Finalize | (Inherited from Object.) |
|
GetHashCode | (Inherited from Object.) |
|
GetType | (Inherited from Object.) |
|
InitializeDatabase | Executes the strategy to initialize the database for the given context. |
|
MemberwiseClone | (Inherited from Object.) |
|
Seed | A that should be overridden to actually add data to the context for seeding. The default implementation does nothing. |
|
ToString | (Inherited from Object.) |