public IActionResult AddStudent([ Bind(nameof(CreateStudentModel.Name), nameof(CreateStudentModel.Email), nameof(CreateStudentModel.Department))] CreateStudentModel model) { if (ModelState.IsValid) { try { model.Create(); return(RedirectToAction("Index")); } catch (Exception ex) { //model.Response = new ResponseModel("Book creation failed.", ResponseType.Failure); } } return(View(model)); }
public IActionResult AddStudent(CreateStudentModel model) { model.Create(); return(View(model)); //return RedirectToAction("Index"); }
public IActionResult AddStudent(CreateStudentModel model) { model.Create(); return(View(model)); }