Ejemplo n.º 1
0
        public override SqlExpression VisitVariableReference(SqlVariableReferenceExpression reference)
        {
            var refName = reference.VariableName;

            var resolver = context.VariableResolver;

            if (context.Request == null)
            {
                throw new ExpressionEvaluateException(String.Format("Cannot dereference variable {0} outside a query context", refName));
            }

            if (resolver == null)
            {
                resolver = context.Request.Context.VariableResolver();
            }

            var variable = resolver.Resolve(new ObjectName(refName));

            if (variable == null)
            {
                return(SqlExpression.Constant(Field.Null()));
            }

            return(SqlExpression.Constant(variable.Evaluate(context.Request)));
        }
Ejemplo n.º 2
0
        public override SqlExpression VisitVariableReference(SqlVariableReferenceExpression reference)
        {
            var refName = reference.VariableName;

            if (context.Request == null)
            {
                throw new ExpressionEvaluateException(String.Format("Cannot dereference variable {0} outside a query context", refName));
            }
            if (context.VariableResolver == null)
            {
                throw new ExpressionEvaluateException("The query context does not handle variables.");
            }


            var variable = context.Request.FindVariable(refName);

            if (variable == null)
            {
                return(SqlExpression.Constant(DataObject.Null()));
            }

            return(SqlExpression.Constant(variable.Value));
        }
Ejemplo n.º 3
0
 public override SqlExpression VisitVariableReference(SqlVariableReferenceExpression reference)
 {
     // TODO: should we also resolve variables?
     return base.VisitVariableReference(reference);
 }
Ejemplo n.º 4
0
 public virtual SqlExpression VisitVariableReference(SqlVariableReferenceExpression reference)
 {
     return SqlExpression.VariableReference(reference.VariableName);
 }
        public override SqlExpression VisitVariableReference(SqlVariableReferenceExpression reference)
        {
            var refName = reference.VariableName;

            if (context.Request == null)
                throw new ExpressionEvaluateException(String.Format("Cannot dereference variable {0} outside a query context", refName));
            if (context.VariableResolver == null)
                throw new ExpressionEvaluateException("The query context does not handle variables.");

            var variable = context.Request.FindVariable(refName);
            if (variable == null)
                return SqlExpression.Constant(DataObject.Null());

            return SqlExpression.Constant(variable.Value);
        }
 public override SqlExpression VisitVariableReference(SqlVariableReferenceExpression reference)
 {
     builder.AppendFormat(":{0}", reference.VariableName);
     return reference;
 }
Ejemplo n.º 7
0
 public override SqlExpression VisitVariableReference(SqlVariableReferenceExpression reference)
 {
     IsConstant = false;
     return(base.VisitVariableReference(reference));
 }
Ejemplo n.º 8
0
 public override SqlExpression VisitVariableReference(SqlVariableReferenceExpression reference)
 {
     builder.AppendFormat(":{0}", reference.VariableName);
     return(reference);
 }
Ejemplo n.º 9
0
 public override SqlExpression VisitVariableReference(SqlVariableReferenceExpression reference)
 {
     IsConstant = false;
     return base.VisitVariableReference(reference);
 }
Ejemplo n.º 10
0
        public override SqlExpression VisitVariableReference(SqlVariableReferenceExpression reference)
        {
            var refName = reference.VariableName;

            var resolver = context.VariableResolver;

            if (context.Request == null)
                throw new ExpressionEvaluateException(String.Format("Cannot dereference variable {0} outside a query context", refName));

            if (resolver == null)
                resolver = context.Request.Context.VariableResolver();

            var variable = resolver.Resolve(new ObjectName(refName));
            if (variable == null)
                return SqlExpression.Constant(Field.Null());

            return SqlExpression.Constant(variable.Evaluate(context.Request));
        }
Ejemplo n.º 11
0
 public virtual SqlExpression VisitVariableReference(SqlVariableReferenceExpression reference)
 {
     return(SqlExpression.VariableReference(reference.VariableName));
 }