Exemplo n.º 1
0
 /// <summary>
 /// Query Count
 /// 查询条数。
 /// </summary>
 /// <typeparam name="TEntity">类型参数</typeparam>
 /// <param name="connection">DbConnection</param>
 /// <param name="predicate">条件表达式目录树</param>
 /// <returns>long</returns>
 public static long Count <TEntity>(this IDbConnection connection, Expression <Func <TEntity, bool> > predicate)
 {
     try
     {
         return(DommelMapper.Count <TEntity>(connection, predicate));
     }
     catch (Exception ex) { throw new Exception(ex.Message); }
 }