Пример #1
0
 public ActionResult Create([Bind] Student student)
 {
     if (ModelState.IsValid)
     {
         objstudent.AddStudent(student);
         return(RedirectToAction("Index"));
     }
     return(View(student));
 }
Пример #2
0
 public IActionResult Create(Student student)
 {
     try
     {
         studentDataAccessLayer.AddStudent(student);
         return(RedirectToAction(nameof(Index)));
     }
     catch
     {
         return(View());
     }
 }
Пример #3
0
        public ActionResult Create(Student student)
        {
            try
            {
                // TODO: Add insert logic here
                studentDataAccessLayer.AddStudent(student);

                return(RedirectToAction(nameof(Index)));
            }
            catch (Exception ex)
            {
                return(View());
            }
        }
Пример #4
0
        public void Post([FromBody] Student student)
        {
            StudentDataAccessLayer studentDataAccessLayer = new StudentDataAccessLayer();

            studentDataAccessLayer.AddStudent(student);
        }
 public void Post([FromBody] Student value)
 {
     sdal.AddStudent(value);
 }
Пример #6
0
        public ActionResult Create(Student student)
        {
            objStudent.AddStudent(student);

            return(RedirectToAction("Index"));
        }
Пример #7
0
 public int Create([FromBody] Student Student)
 {
     return(objStudent.AddStudent(Student));
 }