Exemplo n.º 1
0
        // PUT: api/User/5
        public HttpResponseMessage Put(int id, [FromBody] User User)
        {
            UserPersistence uP            = new UserPersistence();
            bool            recordExisted = false;

            recordExisted = uP.ChangeUser(id, User);
            HttpResponseMessage response;

            if (recordExisted)
            {
                response = Request.CreateResponse(HttpStatusCode.NoContent);
            }
            else
            {
                response = Request.CreateResponse(HttpStatusCode.NotFound);
            }
            return(response);
        }