public HttpResponseMessage GetModificationLevel(HttpRequestMessage request, int modificationLevelId) { return(GetHttpResponse(request, () => { HttpResponseMessage response = null; ModificationLevel modificationLevel = _CoreService.GetModificationLevel(modificationLevelId); // notice no need to create a seperate model object since ModificationLevel entity will do just fine response = request.CreateResponse <ModificationLevel>(HttpStatusCode.OK, modificationLevel); return response; })); }
public HttpResponseMessage DeleteModificationLevel(HttpRequestMessage request, [FromBody] int modificationLevelId) { return(GetHttpResponse(request, () => { HttpResponseMessage response = null; // not that calling the WCF service here will authenticate access to the data ModificationLevel modificationLevel = _CoreService.GetModificationLevel(modificationLevelId); if (modificationLevel != null) { _CoreService.DeleteModificationLevel(modificationLevelId); response = request.CreateResponse(HttpStatusCode.OK); } else { response = request.CreateErrorResponse(HttpStatusCode.NotFound, "No modificationLevel found under that ID."); } return response; })); }
public HttpResponseMessage UpdateModificationLevel(HttpRequestMessage request, [FromBody] ModificationLevel modificationLevelModel) { return(GetHttpResponse(request, () => { var modificationLevel = _CoreService.UpdateModificationLevel(modificationLevelModel); return request.CreateResponse <ModificationLevel>(HttpStatusCode.OK, modificationLevel); })); }
public ModificationLevel UpdateModificationLevel(ModificationLevel modificationLevel) { return(Channel.UpdateModificationLevel(modificationLevel)); }