示例#1
0
        public override async Task <IPagedResults <TModel> > ToList()
        {
            Builder = new EntityQueryBuilder <TModel>(this);
            var populateSql = Builder.BuildSqlPopulate();
            var countSql    = Builder.BuildSqlCount();
            var keywords    = Params?.Keywords.Value.ToEmptyIfNull() ?? string.Empty;

            return(await _store.SelectAsync(new IDbDataParameter[]
            {
                new DbParam("PageIndex", DbType.Int32, PageIndex),
                new DbParam("PageSize", DbType.Int32, PageSize),
                new DbParam("SqlPopulate", DbType.String, populateSql),
                new DbParam("SqlCount", DbType.String, countSql),
                new DbParam("Keywords", DbType.String, keywords)
            }));
        }