Open Closed

Http PATCH method in Abp Framework #4046


User avatar
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)
  • User Avatar
    1
    maliming created
    Support Team Fullstack Developer

    hi

    AddNewtonsoftJson will replace the System Text Json, but I don't think there will be a problem.

Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11