public ActionResult GetFunds(int offset, int limit, string query) { string queryStr = query.Trim(); var data = fundService.GetFundsPaginated(offset, limit, queryStr); if (data == null) { return(new HttpNotFoundResult()); } var fundsVM = Mapper.Map <IEnumerable <Model.V_FundWithLastValue>, IEnumerable <FundModel> >(data); var counter = fundService.CountFunds(query); var fundTableViewModel = new FundTableModel() { TotalCount = counter, Funds = fundsVM }; return(Json(fundTableViewModel)); }