Some other func

This commit is contained in:
2025-01-06 08:58:17 +01:00
parent 8bbcbfab09
commit a80870b5c3
9 changed files with 118 additions and 19 deletions
+8 -6
View File
@@ -4,6 +4,7 @@ using System.Text.Json;
using System.Text.Json.Serialization;
using WorkFlowCheck.API;
using WorkFlowCheck.DL;
using Microsoft.AspNetCore.Mvc;
var builder = WebApplication.CreateBuilder(args);
@@ -45,12 +46,13 @@ builder.Services.AddSwaggerGen(c =>
});
});
// Szolgáltatások hozzáadása
builder.Services.AddControllers().AddJsonOptions(options =>
{
options.JsonSerializerOptions.PropertyNamingPolicy = JsonNamingPolicy.CamelCase;
options.JsonSerializerOptions.DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull;
}); ;
builder.Services.AddControllers()
.AddNewtonsoftJson(options =>
{
// Itt konfigurálhatod az egyedi beállításokat
options.SerializerSettings.NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore;
options.SerializerSettings.ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore;
});
var app = builder.Build();
// Swagger middleware