- Install the dotnet EF CLI tool
To create a new EF Core migration, follow these steps:
- Navigate to the API project directory so that the
.csprojfile is accessible. - Run the migration command, specifying the path to the infrastructure project:
dotnet ef migrations add <migration name> --project <relative path to infrastructure project>
Example:
cd '.\Task Manager.Identity.IdentityAPI\'
dotnet ef migrations add 'Init Migration' --project '..\Task Manager.Identity.Infrastructure\Task Manager.Identity.Infrastructure.csproj'