Exemplo n.º 1
0
        public static WhereClip operator &(WhereClip left, WhereClip right)
        {
            Check.Require(((object)left) != null, "left could not be null.");
            Check.Require(((object)right) != null, "right could not be null.");

            WhereClip newWhere = new WhereClip();
            newWhere.And(left);
            newWhere.And(right);
            return newWhere;
        }
Exemplo n.º 2
0
        public static WhereClip operator >=(object left, ExpressionClip right)
        {
            WhereClip where = new WhereClip();
            if (left == null || left == DBNull.Value)
            {
                where.And(right, QueryOperator.LessOrEqual, null);
            }
            else
            {
                where.And(new ExpressionClip(right.DbType, left),
                    QueryOperator.GreaterOrEqual, right);
            }

            return where;
        }
Exemplo n.º 3
0
        public static WhereClip operator >=(ExpressionClip left, object right)
        {
            WhereClip where = new WhereClip();
            if (right == null || right == DBNull.Value)
            {
                where.And(left, QueryOperator.GreaterOrEqual, null);
            }
            else
            {
                where.And(left, QueryOperator.GreaterOrEqual,
                    new ExpressionClip(left.DbType, right));
            }

            return where;
        }
Exemplo n.º 4
0
        public static WhereClip operator >=(ExpressionClip left, ExpressionClip right)
        {
            WhereClip where = new WhereClip();
            if (ExpressionClip.IsNullOrEmpty(right))
            {
                where.And(left, QueryOperator.GreaterOrEqual, null);
            }
            else if (ExpressionClip.IsNullOrEmpty(left))
            {
                where.And(right, QueryOperator.LessOrEqual, null);
            }
            else
            {
                where.And(left, QueryOperator.GreaterOrEqual, right);
            }

            return where;
        }
Exemplo n.º 5
0
        public static WhereClip operator !=(object left, ExpressionClip right)
        {
            WhereClip where = new WhereClip();
            if (left == null || left == DBNull.Value)
            {
                where = where.And(right, QueryOperator.IsNULL, null).Not();
            }
            else
            {
                where.And(new ExpressionClip(right.DbType, left),
                    QueryOperator.NotEqual, right);
            }

            return where;
        }
Exemplo n.º 6
0
        public static WhereClip operator !=(ExpressionClip left, ExpressionClip right)
        {
            WhereClip where = new WhereClip();
            if (ExpressionClip.IsNullOrEmpty(right))
            {
                where = where.And(left, QueryOperator.IsNULL, null).Not();
            }
            else if (ExpressionClip.IsNullOrEmpty(left))
            {
                where = where.And(right, QueryOperator.IsNULL, null).Not();
            }
            else
            {
                where.And(left, QueryOperator.NotEqual, right);
            }

            return where;
        }