Ejemplo n.º 1
0
        public IHttpActionResult PutPerfil(long id, Reservas reservas)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

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

            try
            {
                reservasService.Update(reservas);
            }
            catch (NoEncontradoException)
            {
                return(NotFound());
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
        public IHttpActionResult PutReservas(long id, Reservas reservas)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

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

            try
            {
                reservasService.Update(id, reservas);
            }
            catch (DbUpdateConcurrencyException)
            {
                return(NotFound());
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }