public ActionResult Create([Bind] Student student) { if (ModelState.IsValid) { objstudent.AddStudent(student); return(RedirectToAction("Index")); } return(View(student)); }
public IActionResult Create(Student student) { try { studentDataAccessLayer.AddStudent(student); return(RedirectToAction(nameof(Index))); } catch { return(View()); } }
public ActionResult Create(Student student) { try { // TODO: Add insert logic here studentDataAccessLayer.AddStudent(student); return(RedirectToAction(nameof(Index))); } catch (Exception ex) { return(View()); } }
public void Post([FromBody] Student student) { StudentDataAccessLayer studentDataAccessLayer = new StudentDataAccessLayer(); studentDataAccessLayer.AddStudent(student); }
public void Post([FromBody] Student value) { sdal.AddStudent(value); }
public ActionResult Create(Student student) { objStudent.AddStudent(student); return(RedirectToAction("Index")); }
public int Create([FromBody] Student Student) { return(objStudent.AddStudent(Student)); }