DropCreateDatabaseAlways<TContext> Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
An implementation of IDatabaseInitializer that will always recreate and optionally re-seed the database the first time that a context is used in the app domain. To seed the database, create a derived class and override the Seed method.
public class DropCreateDatabaseAlways<TContext> : System.Data.Entity.IDatabaseInitializer<TContext> where TContext : DbContext
type DropCreateDatabaseAlways<'Context (requires 'Context :> DbContext)> = class
interface IDatabaseInitializer<'Context (requires 'Context :> DbContext)>
Public Class DropCreateDatabaseAlways(Of TContext)
Implements IDatabaseInitializer(Of TContext)
Type Parameters
- TContext
The type of the context.
- Inheritance
-
DropCreateDatabaseAlways<TContext>
- Implements
Constructors
DropCreateDatabaseAlways<TContext>() |
Initializes a new instance of the DropCreateDatabaseAlways<TContext> class. |
Methods
InitializeDatabase(TContext) |
Executes the strategy to initialize the database for the given context. |
Seed(TContext) |
A method that should be overridden to actually add data to the context for seeding. The default implementation does nothing. |
Applies to
Entity Framework