예제 #1
0
        public async Task <IActionResult> DeleteProblemById([FromRoute] int id)
        {
            try
            {
                await _Repository.DeleteProblemByIdAsync(id);

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