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