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")); }
public IActionResult Delete(int id) { //Get Product from database Student p = StudentDb.GetStudent(context, id); StudentDb.Delete(context, p); return(RedirectToAction("Index")); }
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")); }
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")); }