Exemplo n.º 1
0
        public async Task <ActionResult <ResultDTO> > GetBestResult(string userName, string testName)
        {
            var resultModel = new ResultRequestDTO()
            {
                UserName = userName,
                TestName = testName
            };

            var result = await _resultService.GetBestResultAsync(resultModel);

            if (result != null)
            {
                return(Ok(result));
            }
            else
            {
                return(Problem(
                           title: "Result not found",
                           detail: "Result for this user not found",
                           statusCode: 404));
            }
        }