public IActionResult Put(int id, [FromBody] Student student) { if (id != student.StudentID) { return(NotFound()); } StudentDataAccessLayer studentDataAccessLayer = new StudentDataAccessLayer(); studentDataAccessLayer.UpdateStudent(student); return(Ok()); }
public IActionResult Edit(Student student) { try { studentDataAccessLayer.UpdateStudent(student); return(RedirectToAction(nameof(Index))); } catch { return(View()); } }
public ActionResult Edit(int id, [Bind] Student student) { if (id != student.RollNo) { return(new HttpNotFoundResult("Not Found")); } if (ModelState.IsValid) { objstudent.UpdateStudent(student); return(RedirectToAction("Index")); } return(View(student)); }
public ActionResult Edit(Student student) { try { // TODO: Add update logic here studentDataAccessLayer.UpdateStudent(student); return(RedirectToAction(nameof(Index))); } catch { return(View()); } }
public IActionResult Edit(string id, [Bind] Student student) { if (id != student.StdId) { return(NotFound()); } if (ModelState.IsValid) { objstudent.UpdateStudent(student); return(RedirectToAction("Index")); } return(View(student)); }
public void Put(int id, [FromBody] Student value) { sdal.UpdateStudent(value); }
[HttpPost]// submit operation public ActionResult Edit(Student student) { objStudent.UpdateStudent(student); return(RedirectToAction("Index")); }
public int Edit([FromBody] Student Student) { return(objStudent.UpdateStudent(Student)); }