EF6DatabaseUpdateAliases.

Ef6DatabaseUpdate(ICakeContext, Action<Ef6DatabaseUpdateSettings>) Method

Summary

Applies any pending migrations to the database using the ef6.exe migration tool.

Syntax

public static void Ef6DatabaseUpdate(this ICakeContext context, Action<Ef6DatabaseUpdateSettings> configurator)

Examples

Applies any pending migrations to the database using the ef6.exe migration tool. ('ef6 database update')

Ef6DatabaseUpdate(context, settings =>
    {
        settings
            .FromAssembly("c:/myproject/MyProject.Data.dll")
            .ForceChanges()
            .SetConnectionStringName("MyDataDb")
            .FromConfigurationFile("c:/myproject/app.config")
            .SetMigrationsConfigurationType("MyDb.Configuration.Data.MyDbMigrationsConfiguration")
            .SetVerbose()
            .SetVersion()
            .FromPath(@"c:/myproject");
    });

Attributes

Type Description
CakeMethodAliasAttribute
CakeAliasCategoryAttribute

Parameters

Name Type Description
context ICakeContext The context.
configurator Action<Ef6DatabaseUpdateSettings> The settings configurator.

Return Value

Type Description
void