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 async Task <IActionResult> EditStudent(Student student) { db.Students.Update(student); await db.SaveChangesAsync(); return(RedirectToAction("Index")); }