I was accustomed to using Newtonsoft's JObject in my Asp.net web api's. I could add properties at will using:
JObject x = new JObject() { "myInt", 25 };
//or
x.Add("myInt", 25);
I ran into an error when trying to return a JObject from a ASP.Net core 3.1 web app.
System.NotSupportedException: The collection type 'Newtonsoft.Json.Linq.JObject' is not supported.
So NewtonSoft.Json is not supported in .Net core 3.1. So I looked at this article https://learn.microsoft.com/en-us/dotnet/standard/serialization/system-text-json-migrate-from-newtonsoft-how-to but it seems that you can not add a property to a JsonDocument. This seems very odd and I thought I might be missing some information. So is there a way to add a property and value to a JsonDocument?