Disable the Date deserialization for JObject.Parse in C#.NET

Author: | Posted in .NET, C#, Learn, Uncategorized No comments

There are many ways to achieve this. One way of solving this is by specifying a JsonSerializer which instructs how to handle dates.

var settings = new JsonSerializerSettings()
    DateParseHandling = DateParseHandling.None

The above code specifies the settings on a JsonSerializer object.

But, unfortunately Parse doesn’t have this option. Instead we shall use JsonConvert.DeserializeObject as shown below where jsonString is the object passed.

var data = JsonConvert.DeserializeObject(jsonString, settings);

Add Your Comment