DropCreateDatabaseAlways<TContext> Class

 

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.

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

System.Object
  System.Data.Entity.DropCreateDatabaseAlways<TContext>

public class DropCreateDatabaseAlways<TContext> : IDatabaseInitializer<TContext>
where TContext : DbContext

Type Parameters

TContext

The type of the context.

NameDescription
System_CAPS_pubmethodDropCreateDatabaseAlways<TContext>()

Initializes a new instance of the DropCreateDatabaseAlways<TContext> class.

NameDescription
System_CAPS_pubmethodEquals(Object)

(Inherited from Object.)

System_CAPS_protmethodFinalize()

(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

(Inherited from Object.)

System_CAPS_pubmethodGetType()

(Inherited from Object.)

System_CAPS_pubmethodInitializeDatabase(TContext)

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

System_CAPS_protmethodMemberwiseClone()

(Inherited from Object.)

System_CAPS_protmethodSeed(TContext)

A method that should be overridden to actually add data to the context for seeding. The default implementation does nothing.

System_CAPS_pubmethodToString()

(Inherited from Object.)

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.