I have a Restful WCF Http Service that returns JSON and works great, except the DateTime doesn't format correctly:
e.g. "AdjudDate": "/Date(1349409600000-0400)/"
After looking around I found an old post here but I could not get that code to work. It was last updated in 2011. Is there maybe a more current version or implementation? JSON.NET Serializer for WCF REST Services
Here's my code that returns an IEnumerable.
//All JSON values are good except for the dates:
private IEnumerable<Customer> ProcessWcfPost(Customer searchmodel)
{
return _repository.GetCustomers(searchModel);
}
edit I've also of course tried changing the return type to string instead of IEnumerable as:
private string ProcessWcfPost(Customer searchmodel)
{
var result = _repository.GetCustomers(searchModel);
return Newtonsoft.Json.JsonConvert.SerializeObject(result);
}
But my JSON is not quite right: [{\"ClaimProcessId\":1599986,\"ClmHdrId\":1011,\"ClmLineId\":1011,\"ClmAdjId\":1011,\"ReceivedDtSur\":\"2012-12-05T00:00:00\",\"AdjudicationDtSur\":\"2011-10-05T00:00:00\"(on and on)...