|
|
|
|
@ -52,7 +52,10 @@ namespace isnd
|
|
|
|
|
.Configure<AdminStartupList>(adminStartupListConf)
|
|
|
|
|
.Configure<MigrationsEndPointOptions>(o => o.Path = "~/migrate")
|
|
|
|
|
.AddDbContext<ApplicationDbContext>(options =>
|
|
|
|
|
options.UseNpgsql(Configuration.GetConnectionString("DefaultConnection")))
|
|
|
|
|
options.UseNpgsql(Configuration.GetConnectionString("DefaultConnection"))
|
|
|
|
|
.ConfigureWarnings(w => w.Ignore(RelationalEventId.PendingModelChangesWarning))
|
|
|
|
|
.EnableDetailedErrors()
|
|
|
|
|
)
|
|
|
|
|
.AddIdentity<ApplicationUser, IdentityRole>()
|
|
|
|
|
.AddRoles<IdentityRole>()
|
|
|
|
|
.AddEntityFrameworkStores<ApplicationDbContext>(
|
|
|
|
|
@ -96,7 +99,7 @@ namespace isnd
|
|
|
|
|
s.SerializerSettings.ReferenceResolverProvider = () => new NSJWebApiReferenceResolver();
|
|
|
|
|
})
|
|
|
|
|
.AddXmlSerializerFormatters();
|
|
|
|
|
#if SWAGGER
|
|
|
|
|
#if SWAGGER
|
|
|
|
|
services.AddSwaggerGen(options =>
|
|
|
|
|
{
|
|
|
|
|
options.SwaggerDoc("v1", new OpenApiInfo
|
|
|
|
|
@ -119,7 +122,7 @@ namespace isnd
|
|
|
|
|
var xmlFilename = $"{typeof(Startup).Assembly.GetName().Name}.xml";
|
|
|
|
|
options.IncludeXmlComments(Path.Combine(AppContext.BaseDirectory, xmlFilename));
|
|
|
|
|
});
|
|
|
|
|
#endif
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -134,10 +137,10 @@ namespace isnd
|
|
|
|
|
{
|
|
|
|
|
app.UseDeveloperExceptionPage();
|
|
|
|
|
app.UseMigrationsEndPoint();
|
|
|
|
|
#if SWAGGER
|
|
|
|
|
#if SWAGGER
|
|
|
|
|
app.UseSwagger();
|
|
|
|
|
app.UseSwaggerUI();
|
|
|
|
|
#endif
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
|