public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { var value = reader.Value?.ToString(); if (objectType == typeof(FuzzyRange?)) { return(FuzzyRange.TryParse(value)); } return(FuzzyRange.Parse(value)); }
public override FuzzyRange?Parse(object value) { return(FuzzyRange.TryParse(value?.ToString())); }