Exemple #1
0
        public Expression2SqlCore <T> Count(Expression <Func <T, object> > expression = null)
        {
            this._sqlPack.Clear();
            this._sqlPack.IsSingleTable = true;
            if (expression == null)
            {
                this._sqlPack.Sql.AppendFormat("select count(*) from {0}", typeof(T).Name);
            }
            else
            {
                Expression2SqlProvider.Count(expression.Body, this._sqlPack);
            }

            return(this);
        }
Exemple #2
0
 protected override SqlPack Count(UnaryExpression expression, SqlPack sqlPack)
 {
     Expression2SqlProvider.Count(expression.Operand, sqlPack);
     return(sqlPack);
 }