コード例 #1
0
        private IAggregate GetGeoCentroidAggregate(JsonReader reader, JsonSerializer serializer)
        {
            reader.Read();
            var geoCentroid = new GeoCentroidAggregate {
                Location = serializer.Deserialize <GeoLocation>(reader)
            };

            reader.Read();
            return(geoCentroid);
        }
コード例 #2
0

        
コード例 #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);
        }
コード例 #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);
        }
コード例 #5
0
		private IAggregate GetGeoCentroidAggregate(JsonReader reader, JsonSerializer serializer)
		{
			reader.Read();
			var geoCentroid = new GeoCentroidAggregate { Location = serializer.Deserialize<GeoLocation>(reader) };
			reader.Read();
			return geoCentroid;
		}