Esempio n. 1
0
 public SourceInjectedQuery(IQueryable <TSource> dataSource, IQueryable <TDestination> destQuery,
                            IMappingEngine mappingEngine, SourceInjectedQueryInspector inspector = null)
 {
     Expression  = destQuery.Expression;
     ElementType = typeof(TDestination);
     Provider    = new SourceInjectedQueryProvider <TSource, TDestination>(mappingEngine, dataSource, destQuery)
     {
         Inspector = inspector ?? new SourceInjectedQueryInspector()
     };
 }
        public IQueryDataSourceInjection <TSource> UsingInspector(SourceInjectedQueryInspector inspector)
        {
            _inspector = inspector;

            if (_sourceExpressionTracer != null)
            {
                _beforeMappingVisitors.Insert(0, _sourceExpressionTracer);
            }
            if (_destinationExpressionTracer != null)
            {
                _afterMappingVisitors.Add(_destinationExpressionTracer);
            }

            return(this);
        }
Esempio n. 3
0
 public SourceSourceInjectedQuery(IQueryable <TSource> dataSource,
                                  IQueryable <TDestination> destQuery,
                                  IMapper mapper,
                                  IEnumerable <ExpressionVisitor> beforeVisitors,
                                  IEnumerable <ExpressionVisitor> afterVisitors,
                                  Action <Exception> exceptionHandler,
                                  IObjectDictionary parameters,
                                  MemberPaths membersToExpand,
                                  SourceInjectedQueryInspector inspector)
 {
     Parameters         = parameters;
     EnumerationHandler = (x => { });
     Expression         = destQuery.Expression;
     ElementType        = typeof(TDestination);
     Provider           = new SourceInjectedQueryProvider <TSource, TDestination>(mapper, dataSource, destQuery, beforeVisitors, afterVisitors, exceptionHandler, parameters, membersToExpand)
     {
         Inspector = inspector ?? new SourceInjectedQueryInspector(),
     };
     _exceptionHandler = exceptionHandler ?? ((x) => { });
 }
Esempio n. 4
0
 public IQueryable <TDestination> For <TDestination>(SourceInjectedQueryInspector inspector = null)
 {
     return(new SourceInjectedQuery <TSource, TDestination>(_dataSource,
                                                            new TDestination[0].AsQueryable(), _mappingEngine, inspector));
 }