public BankAccountPagingModel GetBankAccountPagingModel(QueryOptions queryOptions, SearchObject searchObject) { var totalCount = 0; var bankAccountPagingModel = new BankAccountPagingModel(); var bankAccounts = _bankAccountService.GetBankAccounts(queryOptions, searchObject, out totalCount); queryOptions.TotalPages = (int)Math.Ceiling((double)totalCount / queryOptions.PageSize); //This line gets rid of items!! Fix the error var result = new ResultList <BankAccountModel>(bankAccounts.Select(BuildBankAccountModel).ToList(), queryOptions); bankAccountPagingModel.BankAccountEditModels = result; bankAccountPagingModel.SearchObject = new PrimeActs.Domain.ViewModels.BankAccount.SearchObject { FromDate = searchObject.FromDate.HasValue ? searchObject.FromDate.Value : (DateTime?)null, ToDate = searchObject.ToDate.HasValue ? searchObject.ToDate.Value : (DateTime?)null }; return(bankAccountPagingModel); }
public ResultList <BankAccountModel> GetBankAccountModels(QueryOptions queryOptions, SearchObject searchObject) { var totalCount = 0; var list = _bankAccountService.GetBankAccounts(queryOptions, searchObject, out totalCount); return (new ResultList <BankAccountModel>( list != null ? list.Select(BuildBankAccountModel).ToList() : null, queryOptions)); }