public IActionResult DeleteConfirm(Student p)
        {
            StudentDb.Delete(context, p);
            TempData["Message"] = "Student successfully deleted.";


            return(RedirectToAction("Index"));
        }
        public async Task <IActionResult> DeleteConfirm(int id)
        {
            //Get Product from database
            Student p = await StudentDb.GetStudent(context, id);

            await StudentDb.Delete(context, p);

            return(RedirectToAction("Index"));
        }
Example #3
0
        public IActionResult Delete(int id)
        {
            //Get Product from database
            Student p = StudentDb.GetStudent(context, id);

            StudentDb.Delete(context, p);

            return(RedirectToAction("Index"));
        }
Example #4
0
        public IActionResult DeleteConfirm(int id)
        {
            //Get the student to be deleted from the database.
            Student s = StudentDb.GetStudent(context, id);

            //Delete the student from the Database.
            StudentDb.Delete(context, s);

            return(RedirectToAction("Students"));
        }
Example #5
0
        public IActionResult DeleteConfirm(int id)
        {
            //Get Product from database
            Student p = StudentDb.GetStudent(context, id);

            StudentDb.Delete(context, p);

            context.Students.Remove(p);

            context.SaveChanges();

            return(RedirectToAction("Index"));
        }