dotnet ef migrations add Initial --context EsportshubApi.Models.ApplicationDbContext -o YourFolderPath
dotnet ef migrations add
Adds a new migration.
Arguments:
| Argument | Description |
|---|---|
<NAME> |
The name of the migration. |
Options:
| Option | Short | Description |
|---|---|---|
--output-dir <PATH> |
-o |
The directory used to output the files. Paths are relative to the target project directory. Defaults to “Migrations”. |
--namespace <NAMESPACE> |
-n |
The namespace to use for the generated classes. Defaults to generated from the output directory. Added in EF Core 5.0. |
Also here are the common options you can use with this command.
Source