Ejemplo n.º 1
0
 public override void Visit(ExistsNode node, IQueryVisitorContext context)
 {
     if (!String.IsNullOrEmpty(node.Field))
     {
         AddField(node);
     }
 }
        public override void Visit(ExistsNode node, IQueryVisitorContext context)
        {
            var validationInfo = context.GetValidationInfo();

            AddField(validationInfo, node, context);
            AddOperation(validationInfo, "exists", node.Field);
        }
Ejemplo n.º 3
0
 protected internal override void VisitExistsNode(SnapshotBuilder builder, ExistsNode node)
 {
     if (builder.IsVisited(node))
     {
         return;
     }
     builder.AddNode(node, NodeInfo.Create);
     base.VisitExistsNode(builder, node);
 }
Ejemplo n.º 4
0
 protected internal override void VisitExistsNode(SchemaBuilder builder, ExistsNode node)
 {
     if (builder.IsVisited(node))
     {
         return;
     }
     builder.AddNode(node, ReteNode.Create);
     base.VisitExistsNode(builder, node);
 }
Ejemplo n.º 5
0
        public override void Visit(ExistsNode node, IQueryVisitorContext context)
        {
            _writer.WriteLine("Exists: ");
            _writer.Indent++;
            _writer.WriteLineIf(node.Field != null, "Field: {0}", node.Field);
            _writer.WriteLineIf(node.IsNegated.HasValue, "IsNegated: {0}", node.IsNegated);
            _writer.WriteLineIf(node.Prefix != null, "Prefix: {0}", node.Prefix);

            WriteData(node);

            _writer.Indent--;
        }
        public override bool Visit <T, TProperty>(ExistsNode <T, TProperty> node, Func <RuntimeVisitor, bool> next)
        {
            _current = _vertices.Get(node.Id,
                                     id => new Vertex(typeof(ExistsNode <,>), typeof(Token <T, TProperty>), "exists"));

            if (_stack.Count > 0)
            {
                _edges.Add(new Edge(_stack.Peek(), _current, _current.TargetType.Name));
            }

            return(Next(() => base.Visit(node, next)));
        }
Ejemplo n.º 7
0
        public override bool Visit <TT, TTProperty>(ExistsNode <TT, TTProperty> node,
                                                    Func <RuntimeVisitor, bool> next)
        {
            var locator = this as ExistsNodeSelector <TT, TTProperty>;

            if (locator != null)
            {
                locator._node = node;
                return(false);
            }

            return(base.Visit(node, next));
        }
Ejemplo n.º 8
0
        public override void Visit(ExistsNode node, IQueryVisitorContext context)
        {
            var    validationInfo = context.GetValidationInfo();
            string field          = null;

            if (!String.IsNullOrEmpty(node.Field))
            {
                field = String.Equals(validationInfo.QueryType, QueryType.Query) ? node.GetFullName() : node.Field;
                if (!field.StartsWith("@"))
                {
                    validationInfo.ReferencedFields.Add(field);
                }
            }

            AddOperation(validationInfo, "exists", field);
        }
Ejemplo n.º 9
0
        public void Select <TNode>(Node <TNode> node)
            where TNode : class
        {
            _node = null;
            node.Accept(this);

            if (_node == null)
            {
                ExistsNode <T, TProperty> compareNode = _configurator.Exists <T, TProperty>();

                var parentNode = node as Node <Token <T, TProperty> >;
                if (parentNode == null)
                {
                    throw new ArgumentException("Expected " + typeof(T).Tokens() + ", but was "
                                                + typeof(TNode).Tokens());
                }

                parentNode.AddActivation(compareNode);

                _node = compareNode;
            }

            _next.Select(_node);
        }
Ejemplo n.º 10
0
        public override bool Visit <T, TProperty>(ExistsNode <T, TProperty> node, Func <RuntimeVisitor, bool> next)
        {
            Append("ExistsNode[{0}]", Tokens <T>());

            return(Indent(next));
        }
 public override void Visit(ExistsNode node, IQueryVisitorContext context)
 {
     ApplyAlias(node, context);
 }
 public override void Visit(ExistsNode node, IQueryVisitorContext context)
 {
     _builder.Append(node);
 }
Ejemplo n.º 13
0
 public void Visit(ExistsNode node)
 {
     node.Field = GetCustomFieldName(node.Field) ?? node.Field;
 }
Ejemplo n.º 14
0
 public void Visit(ExistsNode node, IQueryVisitorContext context)
 {
     node.Field = GetCustomFieldName(node.Field) ?? node.Field;
 }
 public override Task VisitAsync(ExistsNode node, IQueryVisitorContext context)
 {
     node.Field = GetCustomFieldName(node.Field, Array.Empty <string>());
     return(Task.CompletedTask);
 }
 public Task VisitAsync(ExistsNode node, IQueryVisitorContext context)
 {
     return(Visitor.VisitAsync(node, context));
 }
 public override void Visit(ExistsNode node, IQueryVisitorContext context)
 {
     AddField(node, context);
 }
Ejemplo n.º 18
0
 internal static NodeInfo Create(ExistsNode node)
 {
     return new NodeInfo(NodeType.Exists, string.Empty);
 }
Ejemplo n.º 19
0
 internal static ReteNode Create(ExistsNode node)
 {
     return(new ReteNode(node.Id, NodeType.Exists, rules: node.NodeInfo.Rules));
 }
Ejemplo n.º 20
0
 protected internal virtual void VisitExistsNode(TContext builder, ExistsNode node)
 {
     VisitBetaNode(builder, node);
 }
 public virtual void Visit(ExistsNode node, IQueryVisitorContext context)
 {
 }
 public static QueryBase GetDefaultQuery(this ExistsNode node, IQueryVisitorContext context)
 {
     return(new ExistsQuery {
         Field = node.Field
     });
 }
 public virtual Task VisitAsync(ExistsNode node, IQueryVisitorContext context)
 {
     Visit(node, context);
     return(Task.CompletedTask);
 }
Ejemplo n.º 24
0
 protected internal virtual void VisitExistsNode(TContext context, ExistsNode node)
 {
     VisitBetaNode(context, node);
 }
 public void Visit(ExistsNode node)
 {
     node.Field = GetCustomFieldName(node.Field) ?? node.Field;
 }
Ejemplo n.º 26
0
 internal static NodeInfo Create(ExistsNode node)
 {
     return(new NodeInfo(NodeType.Exists, string.Empty));
 }
Ejemplo n.º 27
0
 public virtual bool Visit <T, TProperty>(ExistsNode <T, TProperty> node, Func <RuntimeVisitor, bool> next)
     where T : class
     where TProperty : class, IEnumerable
 {
     return(next(this));
 }