Beispiel #1
0
        public async Task <IActionResult> GetValue(int id)
        {
            Value value = await _service.GetByIdAsync(id);

            if (value == null)
            {
                return(NotFound());
            }
            return(Ok(value));
        }
Beispiel #2
0
        public async Task <IActionResult> GetValue(int id)
        {
            try
            {
                var value = await _valueService.GetByIdAsync(id);

                if (value == null)
                {
                    return(NotFound());
                }

                return(Ok(value));
            }
            catch (Exception ex)
            {
                _logger.LogError(ex.Message);
                return(StatusCode(500));
            }
        }
Beispiel #3
0
        public async Task <ActionResult <ResponseValueDto> > GetValueById([FromRoute] Guid id)
        {
            var valueResult = await _valueService.GetByIdAsync(id);

            if (valueResult == null)
            {
                return(NotFound(id));
            }

            return(Ok(valueResult));
        }