Exemple #1
0
        /// <summary>
        /// init with TwitterContext
        /// </summary>
        /// <param name="context"></param>
        public TwitterQueryable(TwitterContext context)
        {
            Provider   = new TwitterQueryProvider();
            Expression = Expression.Constant(this);

            // lets provider reach back to TwitterContext,
            // where execute implementation resides
            ((TwitterQueryProvider)Provider).Context = context;
        }
Exemple #2
0
        /// <summary>
        /// modified as internal because LINQ to Twitter is Unusable
        /// without TwitterContext, but provider still needs access
        /// </summary>
        /// <param name="provider">IQueryProvider</param>
        /// <param name="expression">Expression Tree</param>
        internal TwitterQueryable(
            TwitterQueryProvider provider,
            Expression expression)
        {
            if (provider == null)
            {
                throw new ArgumentNullException("provider");
            }

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

            if (!typeof(IQueryable <T>).GetTypeInfo().IsAssignableFrom(expression.Type.GetTypeInfo()))
            {
                throw new ArgumentOutOfRangeException("expression");
            }

            Provider   = provider;
            Expression = expression;
        }