I know I can use the following command to add a new migration and create the database :
dotnet ef migrations add MigrationName -c DbContextName dotnet ef data
Instead of DbContext.Database.Migrate() I should use DbContext.Database.EnsureCreated() method.
DbContext.Database.Migrate()
DbContext.Database.EnsureCreated()