// Comparison is the most nested level
        protected override void Visit(ComparisonExpression exp)
        {
            var model = new ComparisonModel
            {
                ParamName = exp.Param.ParamName,
                Value     = exp.Value.Value,
                Operator  = exp.Operator
            };

            var op = _comparisonOperators.Find(exp.Operator);

            if (op != null)
            {
                model.OperatorDisplayName = op.Name;
                if (!String.IsNullOrWhiteSpace(op.Alias))
                {
                    model.OperatorDisplayName = op.Alias;
                }
            }

            var param = _parameters.Find(x => x.Name.Equals(model.ParamName, StringComparison.OrdinalIgnoreCase));

            if (param != null)
            {
                model.ValueType     = param.ValueType.FullName;
                model.IsNumberValue = param.ValueType.IsNumericType();
            }

            _stack.Push(model);
        }
Ejemplo n.º 2
0
        // Comparison is the most nested level
        protected override void Visit(ComparisonExpression exp)
        {
            var model = new ComparisonModel
            {
                ParamName = exp.Param.ParamName,
                Value = exp.Value.Value,
                Operator = exp.Operator
            };

            var op = _comparisonOperators.Find(exp.Operator);
            if (op != null)
            {
                model.OperatorDisplayName = op.Name;
                if (!String.IsNullOrWhiteSpace(op.Alias))
                {
                    model.OperatorDisplayName = op.Alias;
                }
            }

            var param = _parameters.Find(x => x.Name.Equals(model.ParamName, StringComparison.OrdinalIgnoreCase));
            if (param != null)
            {
                model.ValueType = param.ValueType.FullName;
                model.IsNumberValue = param.ValueType.IsNumericType();
            }

            _stack.Push(model);
        }