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