public ActionResult DeleteConfirmed(int id) { var student = _studentApp.GetById(id); _studentApp.Remove(student); return(RedirectToAction("Index")); }
public IActionResult Delete(Guid?id) { if (id == null) { return(NotFound()); } studentAppService.Remove(id.Value); return(Json("delete success")); }
public IActionResult DeleteConfirmed(Guid id) { _studentAppService.Remove(id); if (!_notifications.HasNotifications()) { return(View(_studentAppService.GetById(id))); } ViewBag.Sucesso = "Student Removed!"; return(RedirectToAction("Index")); }
public IActionResult Remove([FromQuery] Guid Id) { _command = new RemoveStudentCommand(Id); if (!_command.IsVaild()) { List <string> _err = new List <string>(); foreach (var err in _command.ValidationResult.Errors) { _err.Add(err.ErrorMessage); } return(Ok(_err)); } _sevice.Remove(Id); return(Ok()); }
public ActionResult DeleteConfirmed(Guid id) { studentAppService.Remove(id); return(RedirectToAction("Index")); }