feat: implement custom parameter binding convention for ASP.NET Core

This commit is contained in:
2025-12-15 09:45:39 +03:30
parent b31559a29a
commit 73bef104fb
2 changed files with 132 additions and 1 deletions

View File

@@ -31,6 +31,7 @@ using GozareshgirProgramManager.Application.Modules.Users.Commands.CreateUser;
using GozareshgirProgramManager.Infrastructure;
using GozareshgirProgramManager.Infrastructure.Persistence.Seed;
using Microsoft.OpenApi;
using ServiceHost.Conventions;
var builder = WebApplication.CreateBuilder(args);
@@ -170,7 +171,11 @@ builder.Services.AddAuthorization(options =>
// });
builder.Services.AddControllers().AddJsonOptions(options =>
builder.Services.AddControllers(options =>
{
options.Conventions.Add(new ParameterBindingConvention());
})
.AddJsonOptions(options =>
{
options.JsonSerializerOptions.Converters.Add(new JsonStringEnumConverter());
});