I want to send data of object to my Web API. The API accepts a parameter of class, which properties are type of int and string.
This is my class:
publi
In .NET CORE 3.X the serialize/deserialize process is done using System.Text.Json not Newtonsoft Json. Edward's answer did not work entirely for me:
Microsoft.AspNetCore.Mvc.NewtonsoftJson won't make step 2 to compile.services.AddControllers().AddNewtonsoftJson(); - you will receive an error, AddNewtonsoftJson() not recognized.At least this happened to me.
As a fix, uninstall what you've installed at step 1. In package manager console, run: Install-Package Microsoft.AspNetCore.Mvc.NewtonsoftJson -Version 3.0.0-preview8.19405.7 . This worked for me.