public void Test_GroupBy_6() { _clause = new GroupByClause(new SqlServerDialect(), new TestEntityResolver(), new TestEntityAliasRegister()); _clause.GroupBy <Sample>(t => t.Email, "b"); Assert.Equal("Group By [as_Sample].[t_Email] Having b", GetSql()); }
public void Test_GroupBy_1() { _clause.GroupBy("a"); Assert.Equal("Group By [a]", GetSql()); }
/// <summary> /// 分组 /// </summary> /// <typeparam name="TEntity">实体类型</typeparam> /// <param name="columns">分组字段</param> /// <returns></returns> public ISqlBuilder GroupBy <TEntity>(params Expression <Func <TEntity, object> >[] columns) { GroupByClause.GroupBy(columns); return(this); }
/// <summary> /// 分组 /// </summary> /// <typeparam name="TEntity">实体类型</typeparam> /// <param name="column">分组字段</param> /// <param name="having">分组条件</param> /// <returns></returns> public ISqlBuilder GroupBy <TEntity>(Expression <Func <TEntity, object> > column, string having = null) where TEntity : class { GroupByClause.GroupBy(column, having); return(this); }
/// <summary> /// 分组 /// </summary> /// <param name="group">分组字段</param> /// <param name="having">分组条件</param> /// <returns></returns> public ISqlBuilder GroupBy(string @group, string having = null) { GroupByClause.GroupBy(group, having); return(this); }