public async Task <IActionResult> PutModule(int id, Module @module) { if (id != @module.ModId) { return(BadRequest()); } _context.Entry(@module).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ModuleExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutStudent(int id, Student student) { if (id != student.StuId) { return(BadRequest()); } _context.Entry(student).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!StudentExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutLecturer(int id, Lecturer lecturer) { if (id != lecturer.LecId) { return(BadRequest()); } _context.Entry(lecturer).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!LecturerExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }