public async Task <IActionResult> PutSolution([FromRoute] int id, [FromBody] Solution solution) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != solution.Id) { return(BadRequest()); } _context.Entry(solution).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SolutionExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }