public static void Main()
""discriminator"": ""SubTypeOrder"",
""DateTime"": ""2011-09-14T00:00:00-04:00"",
""DateTimeOffset"": ""2011-09-14T00:00:00-04:00""
var subtype = JsonConvert.DeserializeObject<OrderBase>(json);
var stock = JsonConvert.DeserializeObject<Order>(json);
Console.WriteLine(((SubTypeOrder)subtype).DateTime);
Console.WriteLine(stock.DateTime);
Console.WriteLine(((SubTypeOrder)subtype).DateTimeOffset);
Console.WriteLine(stock.DateTimeOffset);
Console.WriteLine("---------------------");
var settings = new JsonSerializerSettings() { DateParseHandling = DateParseHandling.DateTimeOffset };
subtype = JsonConvert.DeserializeObject<OrderBase>(json, settings);
stock = JsonConvert.DeserializeObject<Order>(json, settings);
Console.WriteLine(((SubTypeOrder)subtype).DateTime);
Console.WriteLine(stock.DateTime);
Console.WriteLine(((SubTypeOrder)subtype).DateTimeOffset);
Console.WriteLine(stock.DateTimeOffset);
[JsonConverter(typeof(JsonSubtypes), "discriminator")]
[JsonSubtypes.KnownSubType(typeof(SubTypeOrder), "SubTypeOrder")]
public class SubTypeOrder : OrderBase
public DateTime DateTime { get; set; }
public DateTimeOffset DateTimeOffset { get; set; }
public DateTime DateTime { get; set; }
public DateTimeOffset DateTimeOffset { get; set; }