1

I am trying to implement JsonPatchDocument in .NET Framework 4.8, and the nuget package has installed successfully, and the code builds. But when I try to call an endpoint that accepts HTTP Patch, the JsonPatchDocument I get is null.

I remember reading somewhere that this is because JsonPatchDocument only works with NewtonSoft JSON (which was also installed with the package), but all articles on how to use this as the default JSON parser are focused on .NET Core. They give the following code example:

var builder = WebApplication.CreateBuilder(args);

builder.Services.AddControllers()
    .AddNewtonsoftJson();

But this isn't possible for me to do in .NET Framework. The question is thus, how would I go about doing this in .NET Framework?

Brando Zhang
  • 22,586
  • 6
  • 37
  • 65
NollerNiller
  • 25
  • 1
  • 5

0 Answers0