public static new bool TryParse(
     JObject jObject,
     JsonSerializer serializer,
     out FeedRangeInternal feedRangeInternal)
 {
     try
     {
         feedRangeInternal = FeedRangePartitionKeyRangeConverter.ReadJObject(jObject, serializer);
         return(true);
     }
     catch (JsonReaderException)
     {
         DefaultTrace.TraceError("Unable to parse FeedRange for PartitionKeyRange");
         feedRangeInternal = null;
         return(false);
     }
 }
Exemplo n.º 2
0
        public override object ReadJson(
            JsonReader reader,
            Type objectType,
            object existingValue,
            JsonSerializer serializer)
        {
            if (reader.TokenType == JsonToken.Null)
            {
                return(null);
            }

            if (reader.TokenType != JsonToken.StartObject)
            {
                throw new JsonReaderException();
            }

            JObject jObject = JObject.Load(reader);

            return(FeedRangePartitionKeyRangeConverter.ReadJObject(jObject, serializer));
        }