Esempio n. 1
0
        private IAggregate GetGeoCentroidAggregate(JsonReader reader, JsonSerializer serializer)
        {
            reader.Read();
            var geoCentroid = new GeoCentroidAggregate {
                Location = serializer.Deserialize <GeoLocation>(reader)
            };

            reader.Read();
            return(geoCentroid);
        }
Esempio n. 2
0

        
Esempio n. 3
0
        private IAggregate GetGeoCentroidAggregate(JsonReader reader, JsonSerializer serializer)
        {
            reader.Read();
            var geoCentroid = new GeoCentroidAggregate {
                Location = serializer.Deserialize <GeoLocation>(reader)
            };

            reader.Read();
            if (reader.TokenType == JsonToken.PropertyName && (string)reader.Value == Parser.Count)
            {
                reader.Read();
                geoCentroid.Count = (long)reader.Value;
                reader.Read();
            }
            return(geoCentroid);
        }
Esempio n. 4
0
        private IAggregate GetGeoCentroidAggregate(ref JsonReader reader, IJsonFormatterResolver formatterResolver, IReadOnlyDictionary <string, object> meta)
        {
            var geoLocationFormatter = formatterResolver.GetFormatter <GeoLocation>();
            var geoCentroid          = new GeoCentroidAggregate
            {
                Location = geoLocationFormatter.Deserialize(ref reader, formatterResolver),
                Meta     = meta
            };

            if (reader.GetCurrentJsonToken() == JsonToken.EndObject)
            {
                return(geoCentroid);
            }

            reader.ReadNext();             // ,

            if (reader.ReadPropertyName() == Parser.Count)
            {
                geoCentroid.Count = reader.ReadInt64();
            }

            return(geoCentroid);
        }
		private IAggregate GetGeoCentroidAggregate(JsonReader reader, JsonSerializer serializer)
		{
			reader.Read();
			var geoCentroid = new GeoCentroidAggregate { Location = serializer.Deserialize<GeoLocation>(reader) };
			reader.Read();
			return geoCentroid;
		}