/// <summary> /// 行数 /// </summary> /// <param name="expression"></param> /// <returns></returns> public SqlExpressionCore <T> Count(Expression <Func <T, object> > expression = null) { sqlGenerate.Clear(); if (expression == null) { sqlGenerate.Sql.Append($"select count(*) from {sqlGenerate.TableName}"); } else { SqlExpressionProvider.Count(expression, this.sqlGenerate); } return(this); }
protected override SqlGenerate Count(UnaryExpression expression, SqlGenerate sqlGenerate) { SqlExpressionProvider.Count(expression.Operand, sqlGenerate); return(sqlGenerate); }
protected override SqlGenerate Count(LambdaExpression expression, SqlGenerate sqlGenerate) { SqlExpressionProvider.Count(expression.Body, sqlGenerate); return(sqlGenerate); }