Ejemplo n.º 1
0
 public HttpResponseMessage UpdateSingleIntegerModel(int id, [FromBody] SingleIntegerModel singleIntegerModel)
 {
     if (singleIntegerModel == null)
     {
         return(Request.CreateErrorResponse(HttpStatusCode.NotFound, "data with Id = " + id.ToString() + "not found to update"));
     }
     try
     {
         commonGateway.UpdateSingleIntegerModel(singleIntegerModel);
         return(Request.CreateResponse(HttpStatusCode.OK, singleIntegerModel));
     }
     catch (Exception ex)
     {
         return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ex));
     }
 }