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

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 (objectType == typeof(DateTime) || objectType == typeof(DateTime?)) return true; if (objectType == typeof(DateTimeOffset) || objectType == typeof(DateTimeOffset?)) return true; return false; } } }