<PackageReference Include="Newtonsoft.Json" Version="8.0.2" />

DateTimeConverterBase

public abstract class DateTimeConverterBase : JsonConverter
Provides a base class for converting a DateTime to and from JSON.
using System; namespace Newtonsoft.Json.Converters { public abstract class DateTimeConverterBase : JsonConverter { public override bool CanConvert(Type objectType) { if ((object)objectType == typeof(DateTime) || (object)objectType == typeof(DateTime?)) return true; if ((object)objectType == typeof(DateTimeOffset) || (object)objectType == typeof(DateTimeOffset?)) return true; return false; } } }