public IHttpActionResult PutEtapaParticipante([FromUri] int id, [FromBody] EtapaParticipante ep)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != ep.Id)
            {
                return(BadRequest());
            }

            db.Entry(ep).State = System.Data.Entity.EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(Ok(ep));
        }
Ejemplo n.º 2
0
        public IHttpActionResult PutParticipante([FromUri] int id, [FromBody] Participante participante)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != participante.Id)
            {
                return(BadRequest());
            }

            db.Entry(participante).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(Ok(participante));
        }