Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
IDatabaseInitializer(TContext) Interface

IDatabaseInitializer<TContext> Interface

 

An implementation of this interface is used to initialize the underlying database when an instance of a DbContext derived class is used for the first time. This initialization can conditionally create the database and/or seed it with data. The strategy used is set using the static InitializationStrategy property of the Database class. The following implementations are provided: DropCreateDatabaseIfModelChanges<TContext>, DropCreateDatabaseAlways<TContext>, CreateDatabaseIfNotExists<TContext>.

Namespace:   System.Data.Entity
Assembly:  EntityFramework (in EntityFramework.dll)

public interface IDatabaseInitializer<in TContext>
where TContext : DbContext

Type Parameters

in TContext

NameDescription
System_CAPS_pubmethodInitializeDatabase(TContext)

Executes the strategy to initialize the database for the given context.

Return to top
Show:
© 2015 Microsoft