コード例 #1
0
 /// <summary>
 /// Execute the given query and returns the result as a read only list
 /// </summary>
 public static IReadOnlyList <T> ToList <T>(this ISqlQuery <T> select, DbContext context)
 {
     return(DoConnection(context, conn => select.ToList(conn)));
 }
コード例 #2
0
 /// <summary>
 /// 获取分页列表
 /// </summary>
 /// <typeparam name="T1">参数类型1</typeparam>
 /// <typeparam name="T2">参数类型2</typeparam>
 /// <typeparam name="T3">参数类型3</typeparam>
 /// <typeparam name="T4">参数类型4</typeparam>
 /// <typeparam name="T5">参数类型5</typeparam>
 /// <typeparam name="T6">参数类型6</typeparam>
 /// <typeparam name="T7">参数类型7</typeparam>
 /// <typeparam name="TReturn">返回类型</typeparam>
 /// <param name="sqlQuery">Sql查询对象</param>
 /// <param name="map">映射操作</param>
 /// <param name="parameter">分页参数</param>
 /// <param name="connection">数据库连接</param>
 public static PagerList <TReturn> ToPagerList <T1, T2, T3, T4, T5, T6, T7, TReturn>(this ISqlQuery sqlQuery,
                                                                                     Func <T1, T2, T3, T4, T5, T6, T7, TReturn> map, IPager parameter = null, IDbConnection connection = null)
 {
     return(sqlQuery.PagerQuery(() => sqlQuery.ToList(map, connection), parameter, connection));
 }