public async Task <IActionResult> PutStudent([FromRoute] int id, [FromBody] Student student) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != student.StudentId) { 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> PutJudgesGroup([FromRoute] string id, [FromBody] JudgesGroup judgesGroup) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != judgesGroup.JGroupName) { return(BadRequest()); } _context.Entry(judgesGroup).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!JudgesGroupExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }