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