public async Task <IActionResult> PutStudents(int id, Students students) { if (id != students.Id) { return(BadRequest()); } _context.Entry(students).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!StudentsExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public ActionResult Edit([Bind(Include = "ID,FirstName,LastName,Email,DOB,Password,RePassword")] Students students) { if (ModelState.IsValid) { db.Entry(students).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(students)); }