Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

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>.

Namespace:   System.Data.Entity
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.

Return to top
Show: