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.

Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

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.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.8.0-preview. Updated on September 21, 2026, 06:18
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.