예제 #1
0
        public async Task <IActionResult> GetTestByIdAsync(
            [FromRoute] long testId,
            CancellationToken token = default)
        {
            try
            {
                var serviceResult = await _testsService.GetTestByIdAsync(testId, token);

                return(new OkObjectResult(Mapper.Map <GetTestResponseDto>(serviceResult)));
            }
            catch (Exception)
            {
                return(new NotFoundResult());
            }
        }