public ODataQuery(QueryProviderBase provider)
 {
     if (provider == null)
     {
         throw new ArgumentNullException("provider");
     }
     this.provider   = provider;
     this.expression = Expression.Constant(this);
 }
 public ODataQuery(QueryProviderBase provider, Expression expression)
 {
     if (provider == null)
     {
         throw new ArgumentNullException("provider");
     }
     if (expression == null)
     {
         throw new ArgumentNullException("expression");
     }
     if (!typeof(IQueryable <T>).IsAssignableFrom(expression.Type))
     {
         throw new ArgumentOutOfRangeException("expression");
     }
     this.provider   = provider;
     this.expression = expression;
 }