// GET: Student/Delete public ActionResult Delete(int id) { var studentGroup = studentFacade.GetStudentById(id).StudentGroup; var studentGroupId = studentGroup.Id; studentFacade.DeleteStudent(id); return(View("View", CreateStudentViewModel(studentGroupId))); }
public IHttpActionResult DeleteStudent(Student student) { try { studentFcd.DeleteStudent(student); log.Info($"Student: {student.first_name} {student.last_name} has been removed from database!"); return(Ok()); } catch (Exception ex) { log.Error($"{ex.Message}"); throw ex; } }
public IActionResult DeleteConfirmed(int id) { _studentFacade.DeleteStudent(id); return(RedirectToAction("Index")); }