Esempio n. 1
0
        public AsyncEnumerable(IEnumerable <T> enumerable)
        {
            _source = enumerable.AsQueryable();

            Provider = new AsyncQueryProvider <T>(_source);

            Expression = _source.Expression;
        }
        public AsyncEnumerable(IEnumerable <T> enumerable)
        {
            _innerEnumerable = enumerable;

            var provider = new AsyncQueryProvider <T>(_innerEnumerable);

            Provider = provider;

            if (_innerEnumerable is IQueryable <T> queryable && queryable.Expression is Microsoft.EntityFrameworkCore.Query.QueryRootExpression)
            {
                Expression = queryable.Expression;
            }
            else
            {
                Expression = new QueryRootExpression(provider, new FakeEntityType(typeof(T)));
            }
        }