Export (0) Print
Expand All
3 out of 24 rated this helpful - Rate this topic

Database.SetInitializer<TContext> Method

Entity Framework 5.0

Gets or sets the database initialization strategy. The database initialization strategy is called when DbContext instance is initialized from a DbCompiledModel.

Namespace:  System.Data.Entity
Assembly:  EntityFramework (in EntityFramework.dll)
public static void SetInitializer<TContext>(
	IDatabaseInitializer<TContext> strategy
)
where TContext : DbContext

Type Parameters

TContext

The type of the context.

Parameters

strategy
Type: System.Data.Entity.IDatabaseInitializer<TContext>

The strategy.

The initialization strategy can optionally check for database existence, create a new database, and seed the database with data. The default strategy is an instance of CreateDatabaseIfNotExists<TContext>.

Show:
© 2014 Microsoft. All rights reserved.