maqs-dotnet icon indicating copy to clipboard operation
maqs-dotnet copied to clipboard

Add the ability to JsonSerializerSettings to WebServiceUtils.DeserializeJson<T>

Open FermJacobCSV opened this issue 3 years ago • 0 comments

Existing implementation to workaround the issue.

// Take care of null and missing values encountered during deserialization
var settings = new JsonSerializerSettings
{
	NullValueHandling = NullValueHandling.Ignore,
	MissingMemberHandling = MissingMemberHandling.Ignore
};
var jsonString = responseMessage.Content.ReadAsStringAsync().Result;

return JsonConvert.DeserializeObject<MyObject>(jsonString, settings);

The existing WebServiceUtils does not have the ability to add JsonSerializerSettings to assist with different object mappings coming back

FermJacobCSV avatar Feb 23 '22 15:02 FermJacobCSV