public HttpResponseMessage DeleteCollateralType(HttpRequestMessage request, [FromBody] int collateralTypeId) { return(GetHttpResponse(request, () => { HttpResponseMessage response = null; // not that calling the WCF service here will authenticate access to the data CollateralType collateralType = _LoanService.GetCollateralType(collateralTypeId); if (collateralType != null) { _LoanService.DeleteCollateralType(collateralTypeId); response = request.CreateResponse(HttpStatusCode.OK); } else { response = request.CreateErrorResponse(HttpStatusCode.NotFound, "No collateralType found under that ID."); } return response; })); }