Exemplo n.º 1
0
        public async Task <IActionResult> Get(string id)
        {
            try
            {
                logger.LogInformation("Get id:{0}", id);
                var result = await keyValueRepository.GetKeyValueAsync(id);

                if (result != null)
                {
                    return(new ObjectResult(result));
                }
                return(NotFound());
            }
            catch (Exception ex)
            {
                logger.LogError("Get {0}", ex.Message);
            }
            return(StatusCode(500));
        }