public HttpResponseMessage GetOpexAbcExemption(HttpRequestMessage request, int opexAbcExemptionId) { return(GetHttpResponse(request, () => { HttpResponseMessage response = null; OpexAbcExemption opexAbcExemption = _MPROPEXService.GetOpexAbcExemption(opexAbcExemptionId); // notice no need to create a seperate model object since OpexAbcExemption entity will do just fine response = request.CreateResponse <OpexAbcExemption>(HttpStatusCode.OK, opexAbcExemption); return response; })); }
public HttpResponseMessage DeleteOpexAbcExemption(HttpRequestMessage request, [FromBody] int opexAbcExemptionId) { return(GetHttpResponse(request, () => { HttpResponseMessage response = null; // not that calling the WCF service here will authenticate access to the data OpexAbcExemption opexAbcExemption = _MPROPEXService.GetOpexAbcExemption(opexAbcExemptionId); if (opexAbcExemption != null) { _MPROPEXService.DeleteOpexAbcExemption(opexAbcExemptionId); response = request.CreateResponse(HttpStatusCode.OK); } else { response = request.CreateErrorResponse(HttpStatusCode.NotFound, "No opexAbcExemption found under that ID."); } return response; })); }
public HttpResponseMessage UpdateOpexAbcExemption(HttpRequestMessage request, [FromBody] OpexAbcExemption opexAbcExemptionModel) { return(GetHttpResponse(request, () => { var opexAbcExemption = _MPROPEXService.UpdateOpexAbcExemption(opexAbcExemptionModel); return request.CreateResponse <OpexAbcExemption>(HttpStatusCode.OK, opexAbcExemption); })); }
public OpexAbcExemption UpdateOpexAbcExemption(OpexAbcExemption opexAbcExemption) { return(Channel.UpdateOpexAbcExemption(opexAbcExemption)); }