public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { SwashbuckleStartup.Init(app, Configuration); AuthStartup.Init(app); CorsStartup.Init(app, Configuration); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } app.UseHsts(); app.UseSerilogRequestLogging(); app.UseHttpsRedirection(); app.UseRouting(); app.UseAuthorization(); app.UseEndpoints(endpoints => { endpoints.MapControllers(); }); }
public void ConfigureServices(IServiceCollection services) { SwashbuckleStartup.Init(services, Configuration); DiStartup.Init(services, Configuration); AuthStartup.Init(services, Configuration); CorsStartup.Init(services, Configuration); services .AddControllers() .AddJsonOptions(jsonOptions => { var jsonStringEnumConverter = new JsonStringEnumConverter(); jsonOptions.JsonSerializerOptions.Converters.Add(jsonStringEnumConverter); }); }