I have read a few pieces of conflicting information regarding MVC 4's out-of-the-box support for JSON.NET
I gathered that MVC is serializing JSON by default using JSON.NET now, however I still have the tell-tale MS date format in my JSON output.
Is there any bootstrapping that still needs to be done?
Example action:
//
// GET: /Test/
[HttpGet]
public JsonResult Test()
{
return Json(new {date = DateTime.Now}, JsonRequestBehavior.AllowGet);
}
results in:
{
"date": "/Date(1355399663508)/"
}
It is using Json.net by default for asp.net web api only.
As per release notes Json.NET: We now use and support the popular Json.NET serializer for handling of JSON data. Json.NET is the default JSON serializer used by ASP.NET Web API and it includes support for data contracts, anonymous types, dynamic types, Dates, TimeSpans, object reference preservation, indenting, camel casing and many other useful serialization features.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With