Beispiel #1
0
 public HttpResponseMessage Editar(User user, long id)
 {
     try
     {
         if (ModelState.IsValid)
         {
             var social = new Social();
             user.id = id;
             var result = social.EditarUsuario(user);
             return(Request.CreateResponse(HttpStatusCode.OK, new UserDto(user.Obter(result.id))));
         }
         return(Request.CreateErrorResponse(HttpStatusCode.PreconditionFailed, "Campos incorretos."));
     }
     catch (Exception ex)
     {
         return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex));
     }
 }