Open MacGurk opened 1 year ago
Database is currently initialized on runtime in Program.cs
.
using (var scope = app.Services.CreateScope())
{
var context = scope.ServiceProvider.GetRequiredService<HomeBudgetContext>();
context.Database.Migrate();
}
Not ideal, as it is not recommended in production code as of Microsoft: https://learn.microsoft.com/en-us/ef/core/managing-schemas/migrations/applying?tabs=dotnet-core-cli#apply-migrations-at-runtime
If the database does not exist, it should be created using the EF Core migrations