Ejemplo n.º 1
0
        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());
        }
Ejemplo n.º 2
0
        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."));
            }
        }
Ejemplo n.º 3
0
        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."));
            }
        }