public HttpResponseMessage Update(HttpRequestMessage request, SupportOnlineModel SupportOnlineModel) { return(CreateHttpResponse(request, () => { HttpResponseMessage response = null; if (!ModelState.IsValid) { request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState); } else { var SupportOnlineService = new SupportOnlineService(); SupportOnlineService.Update(SupportOnlineModel); response = request.CreateResponse(HttpStatusCode.OK); } return response; })); }
public HttpResponseMessage DeleteMulti(HttpRequestMessage request, int[] id) { return(CreateHttpResponse(request, () => { HttpResponseMessage response = null; if (!ModelState.IsValid) { response = request.CreateResponse(HttpStatusCode.BadRequest, ModelState); } else { var SupportOnlineService = new SupportOnlineService(); SupportOnlineService.DeleteAll(id); response = request.CreateResponse(HttpStatusCode.OK); } return response; })); }