Ejemplo n.º 1
0
        protected override Provider VisitFilter(FilterProvider provider)
        {
            mappings[provider.Source] = Merge(mappings[provider], mappingsGatherer.Gather(provider.Predicate));
            var newSourceProvider = VisitCompilable(provider.Source);

            mappings[provider] = mappings[provider.Source];

            var predicate = TranslateLambda(provider, provider.Predicate);

            return(newSourceProvider == provider.Source && predicate == provider.Predicate
        ? provider
        : new FilterProvider(newSourceProvider, (Expression <Func <Tuple, bool> >)predicate));
        }
Ejemplo n.º 2
0
        public bool TryAddFilter(FilterProvider filter)
        {
            var tupleAccesses = tupleGatherer.Gather(filter.Predicate);

            if (tupleAccesses.Count == 0)
            {
                return(false);
            }
            return(TryAddCalculateFilter(filter, tupleAccesses));
        }
        // Constructors

        protected ColumnMappingInspector(CompilableProvider originalProvider)
        {
            rootProvider = originalProvider;

            mappings          = new Dictionary <Provider, List <int> >();
            outerColumnUsages = new Dictionary <ApplyParameter, List <int> >();
            mappingsGatherer  = new TupleAccessGatherer((a, b) => { });

            var outerMappingsGatherer = new TupleAccessGatherer(RegisterOuterMapping);

            outerColumnUsageVisitor = new CompilableProviderVisitor((_, e) => {
                outerMappingsGatherer.Gather(e);
                return(e);
            });
        }