Exemplo n.º 1
0
 /// <summary>
 /// Returns a lazyily loaded stream of results using a parameterized query. E.g:
 /// <para>db.SelectLazy(db.From&lt;Person&gt;().Where(x =&gt; x == 40))</para>
 /// </summary>
 public static IEnumerable <T> SelectLazy <T>(this IDbConnection dbConn, SqlExpression <T> expression)
 {
     return(dbConn.ExecLazy(dbCmd => dbCmd.SelectLazy <T>(expression.ToSelectStatement(), expression.Params)));
 }
Exemplo n.º 2
0
 /// <summary>
 /// Selects the multi asynchronous.
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <typeparam name="T2">The type of the t2.</typeparam>
 /// <typeparam name="T3">The type of the t3.</typeparam>
 /// <param name="dbCmd">The database command.</param>
 /// <param name="q">The q.</param>
 /// <param name="token">The cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
 /// <returns>Task&lt;List&lt;Tuple&lt;T, T2, T3&gt;&gt;&gt;.</returns>
 internal static Task <List <Tuple <T, T2, T3> > > SelectMultiAsync <T, T2, T3>(this IDbCommand dbCmd, SqlExpression <T> q, CancellationToken token)
 {
     q.Select(q.CreateMultiSelect <T, T2, T3, EOT, EOT, EOT, EOT, EOT>(dbCmd.GetDialectProvider()));
     return(dbCmd.ExprConvertToListAsync <Tuple <T, T2, T3> >(q.ToSelectStatement(QueryType.Select), q.Params, q.OnlyFields, token));
 }
Exemplo n.º 3
0
 internal static long RowCount <T>(this IDbCommand dbCmd, SqlExpression <T> expression)
 {
     return(dbCmd.Scalar <long>(dbCmd.GetDialectProvider().ToRowCountStatement(expression.ToSelectStatement())));
 }