I'm using Json.NET/newtonsoft and I have the following C# class:
public class EntityDefinition
{
[DataMember]
public string CreatedBy { get; set; }
[DataMember]
[JsonProperty(ItemConverterType = typeof(IsoDateTimeConverter))]
public DateTime CreatedOn { get; set; }
}
When I try to return this class in my wcf I'm getting the following JSON:
{
"GetDefinitionResult": {
"CreatedBy": "Dor",
"CreatedOn": "/Date(1466428742000+0300)/"
}
}
How can I get the date to be parsed without the "Date(", meaning only the milliseconds or in iso format "yyy-mm-dd"
I tried using the JsonProperty convertor but it still returns the "Date()"
[JsonProperty(ItemConverterType = typeof(IsoDateTimeConverter))]