Beispiel #1
0
        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));
        }
Beispiel #2
0
 public IActionResult AddStudent(CreateStudentModel model)
 {
     model.Create();
     return(View(model));
     //return RedirectToAction("Index");
 }
Beispiel #3
0
 public IActionResult AddStudent(CreateStudentModel model)
 {
     model.Create();
     return(View(model));
 }