예제 #1
0
        public async Task Put(Position position, string key, string value)
        {
            // we should think about having some kind of transaction concept around this
            var pkv = new PositionKeyValue { Key = key, Value = value, Latitude = position.Latitude, Longitude = position.Longitude };
            var quadKey = CreateGeoKey(position, key);

            var existingQuadKey = await this.KeyIndex.Get(key);
            if (null != (existingQuadKey))
            {
                // the value already exists, so delete it
                await this.GeoIndex.Delete(existingQuadKey);
            }

            await Task.WhenAll(this.GeoIndex.Put(quadKey, pkv), this.KeyIndex.Put(key, quadKey));
        }
예제 #2
0
        public async Task Put(Position position, string key, string value)
        {
            // we should think about having some kind of transaction concept around this
            var pkv = new PositionKeyValue {
                Key = key, Value = value, Latitude = position.Latitude, Longitude = position.Longitude
            };
            var quadKey = CreateGeoKey(position, key);

            var existingQuadKey = await this.KeyIndex.Get(key);

            if (null != (existingQuadKey))
            {
                // the value already exists, so delete it
                await this.GeoIndex.Delete(existingQuadKey);
            }

            await Task.WhenAll(this.GeoIndex.Put(quadKey, pkv), this.KeyIndex.Put(key, quadKey));
        }