/// <summary> /// 求平均值 /// </summary> /// <typeparam name="TEntity">实体类型</typeparam> /// <param name="expression">列名表达式</param> /// <param name="columnAlias">列别名</param> /// <returns></returns> public virtual ISqlBuilder Avg <TEntity>(Expression <Func <TEntity, object> > expression, string columnAlias = null) where TEntity : class { SelectClause.Avg(expression, columnAlias); return(this); }
public void TestAvg_1() { _clause.Avg("a"); Assert.Equal("Select Avg([a])", GetSql()); }
/// <summary> /// 求平均值 /// </summary> /// <param name="column">列名</param> /// <param name="columnAlias">列别名</param> /// <returns></returns> public virtual ISqlBuilder Avg(string column, string columnAlias = null) { SelectClause.Avg(column, columnAlias); return(this); }