Exemple #1
0
        protected internal void whereNotIn(LambdaExpression field, ICollection args)
        {
            if (jump())
            {
                return;
            }
            var column = SqlExpression.GetColumnName(field);

            if (_where.Length > 0)
            {
                _where.Append(" AND ");
            }
            if (args.Count == 0)
            {
                _where.Append("1=1");
                return;
            }
            _where.Append(column);
            if (args.Count == 1)
            {
                _where.Append(" <> ");
                _where.Append(_paramPrefix);
                _where.Append(_args.Count.ToString());
                return;
            }
            else
            {
                _where.Append(" NOT IN (");
                for (int i = 0; i < args.Count; i++)
                {
                    if (i > 0)
                    {
                        _where.Append(",");
                    }
                    _where.Append(_paramPrefix);
                    _where.Append((_args.Count + i).ToString());
                }
                _where.Append(")");
            }
            foreach (var item in args)
            {
                _args.Add(item);
            }
        }
Exemple #2
0
        protected internal void groupBy(LambdaExpression group)
        {
            if (jump())
            {
                return;
            }
            var column = SqlExpression.GetColumnName(group);

            this.groupBy(column);
        }
Exemple #3
0
        protected internal void orderBy(LambdaExpression order, OrderType type)
        {
            if (jump())
            {
                return;
            }
            var column = SqlExpression.GetColumnName(order);

            if (type == OrderType.Asc)
            {
                orderBySql(column + " ASC");
            }
            else
            {
                orderBySql(column + " DESC");
            }
        }