Example #1
0
 public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
 {
     if (LargeNumTypes.Contains(objectType))
     {
         long result;
         if (reader.Value != null && long.TryParse(reader.Value.ToString(), out result))
         {
             return(result);
         }
         return((long?)null);
     }
     return(reader.Value);
 }
Example #2
0
 public override bool CanConvert(Type objectType)
 {
     //9007199254740992
     return(LargeNumTypes.Contains(objectType));
 }