This commit is contained in:
andrei-mihnea-cerbu
2024-04-08 00:03:24 +03:00
parent 2ccec617a5
commit b48d5ee19e
168 changed files with 2877 additions and 1146 deletions
+5 -8
View File
@@ -20,7 +20,7 @@ builder.Services.AddSwaggerGen(c =>
In = ParameterLocation.Header,
Scheme = "ApiKeyScheme"
});
var key = new OpenApiSecurityScheme()
var key = new OpenApiSecurityScheme
{
Reference = new OpenApiReference
{
@@ -30,9 +30,9 @@ builder.Services.AddSwaggerGen(c =>
In = ParameterLocation.Header
};
var requirement = new OpenApiSecurityRequirement
{
{ key, new List<string>() }
};
{
{ key, new List<string>() }
};
c.AddSecurityRequirement(requirement);
});
@@ -66,8 +66,5 @@ app.Run();
static void EnsureDatabaseCreated(HealthcareManagerDatabase dbContext)
{
// Checking for pending migrations is more efficient than applying migrations unconditionally
if (dbContext.Database.GetPendingMigrations().Any())
{
dbContext.Database.Migrate();
}
if (dbContext.Database.GetPendingMigrations().Any()) dbContext.Database.Migrate();
}