Esempio n. 1
0
        /// <summary>
        /// Concat the specified expression1, operatorType and expression2.
        /// </summary>
        /// <param name="expression1">Expression1.</param>
        /// <param name="operatorType">Operator type.</param>
        /// <param name="expression2">Expression2.</param>
        internal static QueryExpression Concat(QueryExpression expression1, ConcatOperatorType operatorType, QueryExpression expression2)
        {
            if (expression1 == null && expression2 == null)
            {
                return(null);
            }
            else if (expression1 == null && expression2 != null)
            {
                return(expression2);
            }
            else if (expression1 != null && expression2 == null)
            {
                return(expression1);
            }
            DataEntityMapping demapping = null;

            if (expression1.TableMapping != null)
            {
                demapping = expression1.TableMapping;
            }
            else if (expression2.TableMapping != null)
            {
                demapping = expression2.TableMapping;
            }
            QueryExpression newExpression = new QueryExpression(demapping);

            newExpression._expression1  = expression1;
            newExpression._expression2  = expression2;
            newExpression._operatorType = operatorType;
            newExpression.mutliQuery    = expression1.mutliQuery | expression2.mutliQuery;
            return(newExpression);
        }
        internal static DataFieldExpression Concat(DataFieldExpression expression1, ConcatOperatorType operatorType, DataFieldExpression expression2)
        {
            if (expression1 == null && expression2 == null)
            {
                return(null);
            }

            if (expression1 == null)
            {
                return(expression2);
            }

            if (expression2 == null)
            {
                return(expression1);
            }

            var newExpression = new DataFieldExpression
            {
                _expression1  = expression1,
                _expression2  = expression2,
                _operatorType = operatorType
            };

            return(newExpression);
        }
Esempio n. 3
0
        internal static DataFieldExpression Concat(DataFieldExpression expression1, ConcatOperatorType operatorType, DataFieldExpression expression2)
        {
            if (expression1 == null && expression2 == null)
            {
                return(null);
            }
            else if (expression1 == null && expression2 != null)
            {
                return(expression2);
            }
            else if (expression1 != null && expression2 == null)
            {
                return(expression1);
            }
            DataFieldExpression newExpression = new DataFieldExpression();

            newExpression._expression1  = expression1;
            newExpression._expression2  = expression2;
            newExpression._operatorType = operatorType;
            return(newExpression);
        }
Esempio n. 4
0
        /// <summary>
        /// Concat the specified expression1, operatorType and expression2.
        /// </summary>
        /// <param name="expression1">Expression1.</param>
        /// <param name="operatorType">Operator type.</param>
        /// <param name="expression2">Expression2.</param>
        internal static QueryExpression Concat(QueryExpression expression1, ConcatOperatorType operatorType, QueryExpression expression2)
        {
            if (expression1 == null && expression2 == null)
            {
                return(null);
            }

            if (expression1 == null)
            {
                return(expression2);
            }

            if (expression2 == null)
            {
                return(expression1);
            }
            DataEntityMapping deMapping = null;

            if (expression1.TableMapping != null)
            {
                deMapping = expression1.TableMapping;
            }
            else if (expression2.TableMapping != null)
            {
                deMapping = expression2.TableMapping;
            }

            var newExpression = new QueryExpression(deMapping)
            {
                _expression1  = expression1,
                _expression2  = expression2,
                _operatorType = operatorType,
                MultiQuery    = expression1.MultiQuery | expression2.MultiQuery
            };

            return(newExpression);
        }