コード例 #1
0
        public async Task <IActionResult> Get(string id)
        {
            var result = await _couchRepository.GetDocumentAsync(id);

            if (result.IsSuccess)
            {
                // var responseContent = result.SuccessContentObject;
                var responseString = result.SuccessContentObject;

                dynamic task = JObject.Parse(responseString);

                var sResult = JsonConvert.DeserializeObject <ListPharmaDetails>(responseString);
                return(new OkObjectResult(sResult));
            }
            return(new NotFoundObjectResult("NotFound"));
        }
コード例 #2
0
        public async Task <IActionResult> Get(string id)
        {
            _logger.LogInformation("fetching data from couchDB against id {0}", id);
            var result = await _couchRepository.GetDocumentAsync(id);

            if (result.IsSuccess)
            {
                // var responseContent = result.SuccessContentObject;
                var responseString = result.SuccessContentObject;

                dynamic task = JObject.Parse(responseString);

                var sResult = JsonConvert.DeserializeObject <ListPharmaDetails>(responseString);
                _logger.LogInformation("Data from couchDb fetched against id {0}", id);
                return(new OkObjectResult(sResult));
            }
            return(new NotFoundObjectResult("NotFound"));
        }