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