// This constructor is called internally by LINQ
        public CollectionResourceQueryable(IQueryProvider provider, Expression expression)
        {
            if (provider == null)
            {
                throw new ArgumentNullException("provider");
            }

            if (expression == null)
            {
                throw new ArgumentNullException("expression");
            }

            var concreteProvider = provider as CollectionResourceQueryProvider <TResult>;

            if (concreteProvider == null)
            {
                throw new NotSupportedException("Source and destination provider types do not match.");
            }

            this.expression             = expression;
            this.queryProvider          = concreteProvider;
            this.executor               = new CollectionResourceExecutor <TResult>(this.queryProvider.Executor, expression);
            this.queryProvider.Executor = this.executor;
        }
 private CollectionResourceQueryable(IAsyncExecutor <TResult> executor)
 {
     this.expression    = Expression.Constant(this);
     this.executor      = executor;
     this.queryProvider = new CollectionResourceQueryProvider <TResult>(this.executor);
 }
 public CollectionResourceQueryable(string collectionHref, IInternalDataStore dataStore)
 {
     this.expression    = Expression.Constant(this);
     this.executor      = new CollectionResourceExecutor <TResult>(collectionHref, dataStore, this.expression);
     this.queryProvider = new CollectionResourceQueryProvider <TResult>(this.executor);
 }