예제 #1
0
        public async Task <IActionResult> Get(int id)
        {
            Result <Professor> result;
            var professor = await _service.GetProfessor(id);

            if (professor == null)
            {
                result = new Result <Professor>(404, "Professor not exists", null);
                return(NotFound(result));
            }

            result = new Result <Professor>(200, null, professor);
            return(Ok(result));
        }