コード例 #1
0
        public async Task <IActionResult> Get(int id)
        {
            var instructor = await _instructorRepository.GetInstructor(id);

            if (instructor == null)
            {
                return(new NotFoundResult());
            }
            return(new ObjectResult(instructor));
        }
コード例 #2
0
        public IActionResult Update(int id)
        {
            var instructor = _instructorRepository.GetInstructor(id);

            if (instructor == null)
            {
                return(NotFound());
            }

            return(View(instructor));
        }
コード例 #3
0
        // GET: Instructor/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            var instructor = instructorRepository.GetInstructor((int)id);

            if (instructor == null)
            {
                return(HttpNotFound());
            }
            return(View(instructor));
        }
        public ActionResult Details(int id)
        {
            var instructor = instructorRepository.GetInstructor(id);

            return(View(instructor));
        }