예제 #1
0
        public async Task <DocumentServicePostResponse> PostAsync(List <Document> documents)
        {
            var request = new DocumentServicePostRequest()
            {
                Documents = documents
            };
            var response = await _client.PostAsync(request);

            return(response);
        }
예제 #2
0
        public async Task <DocumentServicePostResponse> PostAsync(DocumentServicePostRequest request)
        {
            DocumentServicePostResponse response = new DocumentServicePostResponse();

            try
            {
                await _blogStorageService.AddDocumentsAsync(request.Documents);

                response.Documents = request.Documents.Select(d => d.Id).ToArray();
            }
            catch (System.Exception ex)
            {
                response = new DocumentServicePostResponse()
                {
                    Error = ex.Message
                };
            }
            return(response);
        }