/// <summary> /// 异步查询分页 /// </summary> /// <typeparam name="TEntity"></typeparam> /// <param name="connection"></param> /// <param name="param"></param> /// <param name="page"></param> /// <param name="orderByTypes"></param> /// <param name="predicate"></param> /// <param name="keySelector"></param> /// <param name="transaction"></param> /// <param name="commandTimeout"></param> /// <returns></returns> public static Task <IEnumerable <TEntity> > SelectPageAsync <TEntity>(this IDbConnection connection, object param, PageParam page, Expression <Func <TEntity, bool> > predicate = null, Expression <Func <TEntity, object> > keySelector = null, Dictionary <string, OrderByTypeEnum> orderByTypes = null, IDbTransaction transaction = null, int?commandTimeout = null) where TEntity : BaseEntity { ISqlAdapter adapter = GetSqlAdapter(connection); var sql = adapter.GetPage(page, predicate, keySelector, orderByTypes); if (param == null) { param = adapter.ParamValues; } var result = connection.QueryAsyncExt <TEntity>(sql, param, transaction, commandTimeout); return(result); }