DbMigrationsConfiguration Class

 

Configuration relating to the use of migrations for a given model. You will typically create a configuration class that derives from DbMigrationsConfiguration<TContext> rather than using this class.

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

System.Object
  System.Data.Entity.Migrations.DbMigrationsConfiguration
    System.Data.Entity.Migrations.DbMigrationsConfiguration<TContext>

public class DbMigrationsConfiguration

NameDescription
System_CAPS_pubmethodDbMigrationsConfiguration()

Initializes a new instance of the DbMigrationsConfiguration class.

NameDescription
System_CAPS_pubpropertyAutomaticMigrationDataLossAllowed

Gets or sets a value indicating if data loss is acceptable during automatic migration. If set to false an exception will be thrown if data loss may occur as part of an automatic migration.

System_CAPS_pubpropertyAutomaticMigrationsEnabled

Gets or sets a value indicating if automatic migrations can be used when migrating the database.

System_CAPS_pubpropertyCodeGenerator

Gets or sets the code generator to be used when scaffolding migrations.

System_CAPS_pubpropertyCommandTimeout

Gets or sets the timeout value used for the individual commands within a migration. A null value indicates that the default value of the underlying provider will be used.

System_CAPS_pubpropertyContextKey

Gets or sets the string used to distinguish migrations belonging to this configuration from migrations belonging to other configurations using the same database. This property enables migrations from multiple different models to be applied to applied to a single database.

System_CAPS_pubpropertyContextType

Gets or sets the derived DbContext representing the model to be migrated.

System_CAPS_pubpropertyMigrationsAssembly

Gets or sets the assembly containing code-based migrations.

System_CAPS_pubpropertyMigrationsDirectory

Gets or sets the sub-directory that code-based migrations are stored in. Note that this property must be set to a relative path for a sub-directory under the Visual Studio project root; it cannot be set to an absolute path.

System_CAPS_pubpropertyMigrationsNamespace

Gets or sets the namespace used for code-based migrations.

System_CAPS_pubpropertyTargetDatabase

Gets or sets a value to override the connection of the database to be migrated.

NameDescription
System_CAPS_pubmethodEquals(Object)

(Inherited from Object.)

System_CAPS_protmethodFinalize()

(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

(Inherited from Object.)

System_CAPS_pubmethodGetHistoryContextFactory(String)

Gets the history context factory that is set to be used with a given database provider.

System_CAPS_pubmethodGetSqlGenerator(String)

Gets the SQL generator that is set to be used with a given database provider.

System_CAPS_pubmethodGetType()

(Inherited from Object.)

System_CAPS_protmethodMemberwiseClone()

(Inherited from Object.)

System_CAPS_pubmethodSetHistoryContextFactory(String, Func<DbConnection, String, HistoryContext>)

Adds a new factory for creating HistoryContext instances to be used for a given database provider.

System_CAPS_pubmethodSetSqlGenerator(String, MigrationSqlGenerator)

Adds a new SQL generator to be used for a given database provider.

System_CAPS_pubmethodToString()

(Inherited from Object.)

NameDescription
System_CAPS_pubfieldSystem_CAPS_staticDefaultMigrationsDirectory

The default directory that migrations are stored in.

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