Пример #1
0
 /// <summary>
 /// Renders query using the current dialect
 /// </summary>
 /// <param name="connection">The dialect to use</param>
 /// <param name="query">The query to render</param>
 /// <typeparam name="T">The type the query is for</typeparam>
 /// <returns>The query and arguments</returns>
 public static KeyValuePair <string, object[]> RenderWhereClause <T>(this IDatabaseDialect dialect, Expression <Func <T, bool> > query)
 {
     return(dialect.RenderWhereClause(typeof(T), QueryUtil.FromLambda(query)));
 }
Пример #2
0
 /// <summary>
 /// Returns the number of records that match the query
 /// </summary>
 /// <param name="connection">The connection to use</param>
 /// <param name="query">The where clause to use</param>
 /// <typeparam name="T">The table type</typeparam>
 /// <returns>The count</returns>
 public static long SelectCount <T>(this IDbConnection connection, Expression <Func <T, bool> > query)
 {
     return(SelectCount <T>(connection, QueryUtil.FromLambda(query)));
 }
Пример #3
0
 /// <summary>
 /// Renders query using the current dialect
 /// </summary>
 /// <param name="connection">The connection to get the dialect from</param>
 /// <param name="query">The query to render</param>
 /// <typeparam name="T">The type the query is for</typeparam>
 /// <returns>The query and arguments</returns>
 public static KeyValuePair <string, object[]> RenderWhereClause <T>(this IDbConnection connection, Expression <Func <T, bool> > query)
 {
     return(GetDialect(connection).RenderWhereClause(typeof(T), QueryUtil.FromLambda(query)));
 }