public HttpResponseMessage Update(HttpRequestMessage request, OrderDetailModel OrderDetailModel) { return(CreateHttpResponse(request, () => { HttpResponseMessage response = null; if (!ModelState.IsValid) { request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState); } else { var OrderDetaiServvice = new OrderDetaiServvice(); OrderDetaiServvice.Update(OrderDetailModel); response = request.CreateResponse(HttpStatusCode.OK); } return response; })); }
public HttpResponseMessage Delete(HttpRequestMessage request, int OrderID, int ProductID) { return(CreateHttpResponse(request, () => { HttpResponseMessage response = null; if (!ModelState.IsValid) { response = request.CreateResponse(HttpStatusCode.BadRequest, ModelState); } else { var OrderDetaiServvice = new OrderDetaiServvice(); OrderDetaiServvice.Deleteone(OrderID, ProductID); response = request.CreateResponse(HttpStatusCode.OK); } return response; })); }