Пример #1
0
        internal ValueServiceModel(KeyValueDocument document)
        {
            if (document == null)
            {
                return;
            }

            this.CollectionId = document.CollectionId;
            this.Key          = document.Key;
            this.Data         = document.Data;
            this.ETag         = document.ETag;
            this.Timestamp    = document.Timestamp;
        }
Пример #2
0
        public async Task <ValueServiceModel> GetDocumentAsync(string collectionLink, string collectionId, string key)
        {
            try
            {
                var docId    = KeyValueDocument.GenerateId(collectionId, key);
                var response = await this.client.ReadDocumentAsync($"{collectionLink}/docs/{docId}");

                return(new ValueServiceModel(response));
            }
            catch (Exception ex)
            {
                throw new ResourceNotFoundException($"The document at collection link {collectionLink} requested doesn't exist.", ex);
            }
        }