コード例 #1
0
        /// <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);
        }
コード例 #2
0
 protected override SqlGenerate Count(UnaryExpression expression, SqlGenerate sqlGenerate)
 {
     SqlExpressionProvider.Count(expression.Operand, sqlGenerate);
     return(sqlGenerate);
 }
コード例 #3
0
 protected override SqlGenerate Count(LambdaExpression expression, SqlGenerate sqlGenerate)
 {
     SqlExpressionProvider.Count(expression.Body, sqlGenerate);
     return(sqlGenerate);
 }