EFCoreDatabaseUpdateAliases.

EfCoreDatabaseUpdate(ICakeContext, Action<EfCoreDatabaseUpdateSettings>) Method

Summary

Applies any pending migrations to the database using the ef.dll migration tool.

Syntax

public static void EfCoreDatabaseUpdate(this ICakeContext context, Action<EfCoreDatabaseUpdateSettings> configurator)

Examples

Applies any pending migrations to the database using the ef.dll dotnet tool. ('dotnet ef database update')

EfCoreDatabaseUpdate(context, settings =>
   {
        settings
          .FromPath(@"c:/myproject")
          .SetDbContextClass("MyDbContext")
          .SetMigrationsDll("MyMigrations.dll")
          .SetMigrationsNamespace("My.Demo.Migrations")
          .SetStartupDll("MyWebUI.dll")
          .SetTargetMigration("20201221_MyTable_Change")
          .SetVersion()
          .SetNoColor()
          .SetVerbose();
   });

Attributes

Type Description
CakeMethodAliasAttribute
CakeAliasCategoryAttribute

Parameters

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

Return Value

Type Description
void