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