Exemple #1
0
        public IActionResult Edit(int id)
        {
            var student = _repo.ReadStudent(id);

            if (student == null)
            {
                return(RedirectToAction("Index", "Home"));
            }
            return(View(student));
        }
Exemple #2
0
        public IActionResult Index([Bind(Prefix = "id")] int studentId)
        {
            var student = _repo.ReadStudent(studentId);

            if (student == null)
            {
                return(NotFound());
            }
            return(View(student));
        }