コード例 #1
0
        public async Task <IActionResult> GetProblemById([FromRoute] int id)
        {
            try
            {
                var problem = await _Repository.GetProblemByIdAsync(id);

                return(Ok(problem));
            }
            catch (ProblemNotFound e)
            {
                _Logger.LogError("Problem {e.Id} not found", e.Id);
                return(NotFound(new { id = e.Id }));
            }
        }