0
ademaygun created
- ABP Framework version: v5.3.3
- UI type: Angular
- DB provider: EF Core
- Tiered (MVC) or Identity Server Separated (Angular): no
- Exception message and stack trace:
- no exception
- Steps to reproduce the issue:"
I wrote Http Patch method in an application service.To make run patch method regarding to this url I added below codes to Program.cs:
try
{
Log.Information("Starting Sample.V6.HttpApi.Host.");
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddControllers().AddNewtonsoftJson(); // ONLY ADDED THIS LINE
builder.Host
.AddAppSettingsSecretsJson()
.UseAutofac()
.UseSerilog();
await builder.AddApplicationAsync<IntHttpApiHostModule>();
var app = builder.Build();
await app.InitializeApplicationAsync();
await app.RunAsync();
return 0;
}
Added this nuget package : https://www.nuget.org/packages/Microsoft.AspNetCore.Mvc.NewtonsoftJson/Microsoft.AspNetCore.Mvc.NewtonsoftJson
Is these steps okay especially do adding builder.Services.AddControllers().AddNewtonsoftJson();
may cause any problem?
Note: I tested patch method and it run successfully.
1 Answer(s)
-
1
hi
AddNewtonsoftJson
will replace the System Text Json, but I don't think there will be a problem.