public async Task <ActionResult <CommandOutDto> > GetCommandById([FromRoute] string id) { try { var _id = new Guid(id); var command = await _repository.GetCommandByIdAsync(_id); if (command != null) { return(Ok(_mapper.Map <CommandOutDto>(command))); } else { return(NoContent()); } } catch (Exception ex) { return(StatusCode(StatusCodes.Status500InternalServerError, new ErrorResponseDto(ex, false))); } }