public async Task <IActionResult> PutTblGames(int id, TblGames tblGames) { if (id != tblGames.Id) { return(BadRequest()); } _context.Entry(tblGames).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TblGamesExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public HttpResponseMessage PatchChallengeQuestion(ChallengeQuestion challengeQuestion) { if (challengeQuestion == null) { return(Request.CreateResponse(HttpStatusCode.BadRequest)); } try { db.Entry <ChallengeQuestion>(challengeQuestion).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); var result = challengeQuestion; return(Request.CreateResponse(HttpStatusCode.OK, result)); } catch (Exception) { return(Request.CreateResponse(HttpStatusCode.InternalServerError, "Falha ao Alterar Pergunta-Desafio.")); } }
public HttpResponseMessage PatchMatches(Match match) { if (match == null) { return(Request.CreateResponse(HttpStatusCode.BadRequest)); } try { db.Entry <Match>(match).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); var result = match; return(Request.CreateResponse(HttpStatusCode.OK, result)); } catch (Exception) { return(Request.CreateResponse(HttpStatusCode.InternalServerError, "Falha ao Alterar Partida.")); } }