public DataSourceLoaderImpl(IQueryable <S> source, DataSourceLoadOptionsBase options, CancellationToken cancellationToken, bool sync)
        {
            var providerInfo = new QueryProviderInfo(source.Provider);
            var guardNulls   = providerInfo.IsLinqToObjects;

            if (!sync)
            {
                AsyncHelper = new AsyncHelper(source.Provider, providerInfo, cancellationToken);
            }

#if DEBUG
            ExpressionWatcher = options.ExpressionWatcher;
            UseEnumerableOnce = options.UseEnumerableOnce;
            guardNulls        = guardNulls && !options.SuppressGuardNulls;
#endif

            Source  = source;
            Context = new DataSourceLoadContext(options, providerInfo, typeof(S));
            Builder = new DataSourceExpressionBuilder <S>(
                Context,
                guardNulls,
                new AnonTypeNewTweaks {
                AllowEmpty         = !providerInfo.IsL2S,
                AllowUnusedMembers = !providerInfo.IsL2S
            }
                );
        }
        public DataSourceLoaderImpl(IQueryable source, DataSourceLoadOptionsBase options, CancellationToken cancellationToken, bool sync)
        {
            var providerInfo = new QueryProviderInfo(source.Provider);

            Source         = source;
            Context        = new DataSourceLoadContext(options, providerInfo, Source.ElementType);
            CreateExecutor = expr => new ExpressionExecutor(Source.Provider, expr, providerInfo, cancellationToken, sync, options.AllowAsyncOverSync);

#if DEBUG
            ExpressionWatcher = options.ExpressionWatcher;
            UseEnumerableOnce = options.UseEnumerableOnce;
#endif
        }
        public DataSourceLoaderImpl(IQueryable <S> source, DataSourceLoadOptionsBase options)
        {
#if DEBUG
            ExpressionWatcher = options.ExpressionWatcher;
            UseEnumerableOnce = options.UseEnumerableOnce;
#endif

            var providerInfo = new QueryProviderInfo(source.Provider);

            Source  = source;
            Context = new DataSourceLoadContext(options, providerInfo, typeof(S));
            Builder = new DataSourceExpressionBuilder <S>(
                Context,
                providerInfo.IsLinqToObjects,
                new AnonTypeNewTweaks {
                AllowEmpty         = !providerInfo.IsL2S,
                AllowUnusedMembers = !providerInfo.IsL2S
            }
                );
        }
Beispiel #4
0
 public DataSourceExpressionBuilder(DataSourceLoadContext context, bool guardNulls = false, AnonTypeNewTweaks anonTypeNewTweaks = null)
 {
     _context           = context;
     _guardNulls        = guardNulls;
     _anonTypeNewTweaks = anonTypeNewTweaks;
 }
 public DataSourceExpressionBuilder(Expression expr, DataSourceLoadContext context)
 {
     Expr    = expr;
     Context = context;
 }