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)); }
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)); }
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)); }
public override FilterNode <TValue> Visit(LogicalFilter <TValue> nodeIn) { return(new LogicalFilter <TValue>(nodeIn.Type, nodeIn.Filters.Select(x => x.Accept(this)).ToList())); }
public virtual T Visit(LogicalFilter <TValue> nodeIn, TArgs args) { throw new NotImplementedException(); }
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)); }