Exemple #1
0
        public override async Task <IQueryNode> AcceptAsync(IQueryNode node, IQueryVisitorContext context)
        {
            await node.AcceptAsync(this, context).ConfigureAwait(false);

            var validationInfo = context.GetValidationInfo();
            var validator      = context.GetValidator();

            if (validator != null && ShouldThrow && !await validator(validationInfo))
            {
                throw new QueryValidationException();
            }

            return(node);
        }
        public override async Task <IQueryNode> AcceptAsync(IQueryNode node, IQueryVisitorContext context)
        {
            var rootResolver = context.GetRootAliasResolver();

            if (rootResolver != null)
            {
                if (node is GroupNode)
                {
                    node.SetAliasResolver(rootResolver);
                }
                else
                {
                    throw new InvalidOperationException("Node must be GroupNode.");
                }
            }

            await node.AcceptAsync(this, context).ConfigureAwait(false);

            return(node);
        }
Exemple #3
0
        public override async Task <string> AcceptAsync(IQueryNode node, IQueryVisitorContext context)
        {
            await node.AcceptAsync(this, context);

            return(_builder.ToString());
        }
 public override Task <FilterScope> AcceptAsync(IQueryNode node, IQueryVisitorContext context)
 {
     node.AcceptAsync(this, context);
     return(Task.FromResult(_scope));
 }
 public override Task <ISet <string> > AcceptAsync(IQueryNode node, IQueryVisitorContext context)
 {
     node.AcceptAsync(this, context);
     return(Task.FromResult <ISet <string> >(_fields));
 }
 public override Task <IQueryNode> AcceptAsync(IQueryNode node, IQueryVisitorContext context)
 {
     return(node.AcceptAsync(this, context));
 }
Exemple #7
0
        public override async Task <IQueryNode> AcceptAsync(IQueryNode node, IQueryVisitorContext context)
        {
            await node.AcceptAsync(this, context).AnyContext();

            return(node);
        }
        public override async Task <IQueryNode> AcceptAsync(IQueryNode node, IQueryVisitorContext context)
        {
            await node.AcceptAsync(this, context).ConfigureAwait(false);

            return(node);
        }
        public override async Task <IEnumerable <IFieldSort> > AcceptAsync(IQueryNode node, IQueryVisitorContext context)
        {
            await node.AcceptAsync(this, context).ConfigureAwait(false);

            return(_fields);
        }