public HttpResponseMessage UpdateCDQMTitle(HttpRequestMessage request, [FromBody] CDQMTitle cdqmTitleModel) { return(GetHttpResponse(request, () => { var cdqmTitle = _CDQMService.UpdateCDQMTitle(cdqmTitleModel); return request.CreateResponse <CDQMTitle>(HttpStatusCode.OK, cdqmTitle); })); }
public HttpResponseMessage GetCDQMTitle(HttpRequestMessage request, int cdqmTitleId) { return(GetHttpResponse(request, () => { HttpResponseMessage response = null; CDQMTitle cdqmTitle = _CDQMService.GetCDQMTitle(cdqmTitleId); // notice no need to create a seperate model object since CDQMTitle entity will do just fine response = request.CreateResponse <CDQMTitle>(HttpStatusCode.OK, cdqmTitle); return response; })); }
public HttpResponseMessage DeleteCDQMTitle(HttpRequestMessage request, [FromBody] int cdqmTitleId) { return(GetHttpResponse(request, () => { HttpResponseMessage response = null; // not that calling the WCF service here will authenticate access to the data CDQMTitle cdqmTitle = _CDQMService.GetCDQMTitle(cdqmTitleId); if (cdqmTitle != null) { _CDQMService.DeleteCDQMTitle(cdqmTitleId); response = request.CreateResponse(HttpStatusCode.OK); } else { response = request.CreateErrorResponse(HttpStatusCode.NotFound, "No cdqmTitle found under that ID."); } return response; })); }
public CDQMTitle UpdateCDQMTitle(CDQMTitle cdqmTitle) { return(Channel.UpdateCDQMTitle(cdqmTitle)); }