ASP.Net Core 2.2 allows to set serializer settings using MvcJsonOptions.SerializerSettings
property. The problem is that it affects both input and output. Is there
I would use JsonSerializerSettings class from Newtonsoft.Json to define two instances mySerializeSetting
and myDeserializeSettings
.
using Newtonsoft.Json;
using Microsoft.Rest.Serialization;
string requestContent = SafeJsonConvert.SerializeObject(value, mySerializationSettings);
To deserialize:
var result = SafeJsonConvert.DeserializeObject(input, myDeserializeSettings);
To see how to set up serialization settings see https://www.newtonsoft.com/json/help/html/SerializationSettings.htm