public void TestCount_1() { _clause.Count(); Assert.Equal("Select Count(*)", GetSql()); }
/// <summary> /// 求总行数 /// </summary> /// <param name="columnAlias">列别名</param> /// <returns></returns> public ISqlBuilder Count(string columnAlias = null) { SelectClause.Count(columnAlias); return(this); }
/// <summary> /// 求总行数 /// </summary> /// <typeparam name="TEntity">实体类型</typeparam> /// <param name="expression">列名表达式</param> /// <param name="columnAlias">列别名</param> /// <returns></returns> public virtual ISqlBuilder Count <TEntity>(Expression <Func <TEntity, object> > expression, string columnAlias = null) where TEntity : class { SelectClause.Count(expression, columnAlias); return(this); }
public void TestCount_1() { _clause.Count(); Assert.Equal("Select Count(*)", GetSql()); Assert.True(_clause.IsAggregation); }
/// <summary> /// 求总行数 /// </summary> /// <param name="column">列</param> /// <param name="columnAlias">列别名</param> /// <returns></returns> public virtual ISqlBuilder Count(string column, string columnAlias) { SelectClause.Count(column, columnAlias); return(this); }