Esempio n. 1
0
        public override FilterNode <TValue>?Visit(LogicalFilter <TValue> nodeIn)
        {
            var pruned = new List <FilterNode <TValue> >(nodeIn.Filters.Count);

            foreach (var filter in nodeIn.Filters)
            {
                var transformed = filter.Accept(this);

                if (transformed != null)
                {
                    pruned.Add(transformed);
                }
            }

            if (pruned.Count == 1)
            {
                return(pruned[0]);
            }

            if (pruned.Count == 0)
            {
                return(null);
            }

            return(new LogicalFilter <TValue>(nodeIn.Type, pruned));
        }
Esempio n. 2
0
        public override FilterNode <TValue>?Visit(LogicalFilter <TValue> nodeIn)
        {
            var pruned = nodeIn.Filters.Select(x => x.Accept(this) !).NotNull().ToList();

            if (pruned.Count == 1)
            {
                return(pruned[0]);
            }

            if (pruned.Count == 0)
            {
                return(null);
            }

            return(new LogicalFilter <TValue>(nodeIn.Type, pruned));
        }
        public override async ValueTask <FilterNode <TValue>?> Visit(LogicalFilter <TValue> nodeIn)
        {
            var pruned = new List <FilterNode <TValue> >(nodeIn.Filters.Count);

            foreach (var inner in nodeIn.Filters)
            {
                var transformed = await inner.Accept(this);

                if (transformed != null)
                {
                    pruned.Add(transformed);
                }
            }

            return(new LogicalFilter <TValue>(nodeIn.Type, pruned));
        }
Esempio n. 4
0
        public override FilterNode <TValue>?Visit(LogicalFilter <TValue> nodeIn, TArgs args)
        {
            var pruned = new List <FilterNode <TValue> >(nodeIn.Filters.Count);

            foreach (var inner in nodeIn.Filters)
            {
                var transformed = inner.Accept(this, args);

                if (transformed != null)
                {
                    pruned.Add(transformed);
                }
            }

            return(new LogicalFilter <TValue>(nodeIn.Type, pruned));
        }
Esempio n. 5
0
 public override FilterNode <TValue> Visit(LogicalFilter <TValue> nodeIn)
 {
     return(new LogicalFilter <TValue>(nodeIn.Type, nodeIn.Filters.Select(x => x.Accept(this)).ToList()));
 }
Esempio n. 6
0
 public virtual T Visit(LogicalFilter <TValue> nodeIn, TArgs args)
 {
     throw new NotImplementedException();
 }
Esempio n. 7
0
        public override FilterNode <TValue>?Visit(LogicalFilter <TValue> nodeIn)
        {
            var inner = nodeIn.Filters.Select(x => x.Accept(this) !).NotNull().ToList();

            return(new LogicalFilter <TValue>(nodeIn.Type, inner));
        }