Class MigrateDbContextTask<T>
Applies code first migrations for the specified Entity Framework DB Context This task name is "migrate"
public class MigrateDbContextTask<T> : IApplicationTask where T : DbContext
Type Parameters
TThe DBContext which to migrate
- Inheritance
-
MigrateDbContextTask<T>
- Implements
- Inherited Members
Examples
dotnet run runtask=migrate
Constructors
MigrateDbContextTask(T, ILogger<MigrateDbContextTask<T>>)
public MigrateDbContextTask(T db, ILogger<MigrateDbContextTask<T>> logger)
Parameters
dbTloggerILogger<MigrateDbContextTask<T>>
Properties
Name
Gets globally unique name for the task
public string Name { get; }
Property Value
Methods
Run()
Action which to run
public void Run()