Database::SetInitializer<TContext> Method (IDatabaseInitializer<TContext>^)
Entity Framework 6.0
Sets the database initializer to use for the given context type. The database initializer is called when a the given DbContext type is used to access a database for the first time. The default strategy for Code First contexts is an instance of CreateDatabaseIfNotExists<TContext>.
Assembly: EntityFramework (in EntityFramework.dll)
public: generic<typename TContext> where TContext : DbContext static void SetInitializer( IDatabaseInitializer<TContext>^ strategy )
Parameters
- strategy
-
Type:
System.Data.Entity::IDatabaseInitializer<TContext>^
The initializer to use, or null to disable initialization for the given context type.
Type Parameters
- TContext
The type of the context.
Show: