public HttpResponseMessage Update(int id, GalleryImage model) { model.Id = id; if (!ModelState.IsValid) { return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState)); } try { galleryImageService.Update(model); SuccessResponse resp = new SuccessResponse(); return(Request.CreateResponse(HttpStatusCode.OK, resp)); } catch (Exception ex) { return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ex.Message)); } }