This commit is contained in:
Paul Schneider 2023-03-14 00:15:42 +00:00
commit 6f79be26d8
33 changed files with 554 additions and 369 deletions

View file

@ -1,4 +1,6 @@
using Microsoft.AspNetCore.Builder;
using System.Linq;
using System.Collections.Generic;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
@ -22,9 +24,14 @@ using Microsoft.OpenApi.Models;
using System.IO;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
using System.Text.Json;
using System.Text.Json.Serialization;
using isnd.Data.Catalog;
using Newtonsoft.Json;
namespace isnd
{
public class Startup
{
@ -97,8 +104,11 @@ namespace isnd
ValidateAudience = false
};
});
services.AddControllersWithViews();
services.AddControllersWithViews()
.AddNewtonsoftJson(s => {
s.SerializerSettings.ReferenceResolverProvider = () => new NSJWebApiReferenceResolver();
} );
services.AddSwaggerGen(options =>
{
options.SwaggerDoc("v1", new OpenApiInfo
@ -135,7 +145,6 @@ namespace isnd
app.UseMigrationsEndPoint();
app.UseSwagger();
app.UseSwaggerUI();
}
else
{
@ -145,7 +154,6 @@ namespace isnd
}
app.UseStatusCodePages().UseStaticFiles().UseAuthentication();
app.UseMvcWithDefaultRoute();
}
}
}