public HttpResponseMessage GetLoanPrybySchedule(HttpRequestMessage request, string schType) { return(GetHttpResponse(request, () => { HttpResponseMessage response = null; LoanPry[] loanpry = _IFRSDataService.GetLoanPryByScheduleType(schType); // notice no need to create a seperate model object since TBillsComputationResult entity will do just fine response = request.CreateResponse <LoanPry[]>(HttpStatusCode.OK, loanpry.ToArray()); return response; })); }