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