Exemplo n.º 1
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);
        }
 public static QueryBase GetDefaultQuery(this ExistsNode node, IQueryVisitorContext context)
 {
     return(new ExistsQuery {
         Field = node.GetFullName()
     });
 }