public HttpResponseMessage GetLoanPeriodicSchedule(HttpRequestMessage request, string refno) { return(GetHttpResponse(request, () => { HttpResponseMessage response = null; LoanPeriodicSchedule[] loanperiodicschedule = _IFRSDataService.GetLoanPeriodicSchedulebyRefNo(refno); // notice no need to create a seperate model object since LoanPeriodicSchedule entity will do just fine response = request.CreateResponse <LoanPeriodicSchedule[]>(HttpStatusCode.OK, loanperiodicschedule); return response; })); }