コード例 #1
0
            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));
            }
コード例 #2
0
 public override FuzzyRange?Parse(object value)
 {
     return(FuzzyRange.TryParse(value?.ToString()));
 }