public async Task <IActionResult> PutSubmission(int id, Submission submission) { if (id != submission.Id) { return(BadRequest()); } _context.Entry(submission).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SubmissionExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutCodingChallenge(int id, CodingChallenge codingChallenge) { if (id != codingChallenge.Id) { return(BadRequest()); } _context.Entry(codingChallenge).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CodingChallengeExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }