I made a dotnet core console app that serializes a custom object using Newtonsoft.Json v12.0.3.
I want to be able to serialize my custom objects DateTime property without quotes.
I'm trying to avoid making a custom JsonConverter or changing the datatype to be an int or other number types. I'm using DateFormatConverter from here: https://stackoverflow.com/a/44893493/1440321
[JsonConverter(typeof(DateFormatConverter), "yyyyMMdd")]
[JsonProperty("fileGenerationDate", Order = 3)]
public DateTime FileGenerationDate { get; set; }
Desired Output:
{
...
"fileGenerationDate": 20180919
}
Current Output:
{
...
"fileGenerationDate": "20180919"
}