migratrion
This commit is contained in:
@@ -64,6 +64,21 @@ builder.Services.AddSwaggerGen();
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
using (var scope = app.Services.CreateScope())
|
||||
{
|
||||
var services = scope.ServiceProvider;
|
||||
try
|
||||
{
|
||||
var context = services.GetRequiredService<ApplicationDbContext>();
|
||||
context.Database.Migrate();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
var logger = services.GetRequiredService<ILogger<Program>>();
|
||||
logger.LogError(ex, "An error occurred while migrating the database.");
|
||||
}
|
||||
}
|
||||
|
||||
// --- START: HTTP REQUEST PIPELINE KONFIGURIEREN ---
|
||||
|
||||
app.UseForwardedHeaders(new ForwardedHeadersOptions
|
||||
|
||||
Reference in New Issue
Block a user