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