private class Restrictions { [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public DateTime? minDate { get; set; } [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public DateTime? maxDate { get; set; } }