code cleanup

This commit is contained in:
Paul Schneider 2023-04-08 13:36:58 +01:00
commit e8eee642c2
4 changed files with 13 additions and 218 deletions

View file

@ -58,14 +58,14 @@ namespace isnd
.AddDbContext<ApplicationDbContext>(options =>
options.UseNpgsql(
Configuration.GetConnectionString("DefaultConnection")))
.AddIdentity<ApplicationUser, IdentityRole>()
.AddIdentity<ApplicationUser, IdentityRole>()
.AddRoles<IdentityRole>()
.AddEntityFrameworkStores<ApplicationDbContext>()
.AddSignInManager()
.AddDefaultUI()
.AddDefaultTokenProviders();
.AddSignInManager()
.AddDefaultUI()
.AddDefaultTokenProviders();
services.AddMvc(o=>o.EnableEndpointRouting = false);
services.AddMvc(o => o.EnableEndpointRouting = false);
services.AddDataProtection();
@ -106,9 +106,10 @@ namespace isnd
});
services.AddControllersWithViews()
.AddNewtonsoftJson(s => {
s.SerializerSettings.ReferenceResolverProvider = () => new NSJWebApiReferenceResolver();
} );
.AddNewtonsoftJson(s =>
{
s.SerializerSettings.ReferenceResolverProvider = () => new NSJWebApiReferenceResolver();
});
services.AddSwaggerGen(options =>
{
options.SwaggerDoc("v1", new OpenApiInfo
@ -136,8 +137,8 @@ namespace isnd
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app,
IWebHostEnvironment env,
ApplicationDbContext dbContext,
IOptions<IsndSettings> isnSettingsOption )
ApplicationDbContext dbContext,
IOptions<IsndSettings> isnSettingsOption)
{
if (env.IsDevelopment())
{