/// <summary>
        /// Initializes a new instance of the <see cref="PostgreSqlOrderedQuerableProvider{TResult}"/> class.
        /// </summary>
        /// <param name="provider">The query provider this instance is to be created for</param>
        public PostgreSqlOrderedQuerableProvider(PostgreSqlQueryProvider provider)
        {
            if (provider == null)
            {
                throw new ArgumentNullException(nameof(provider));
            }

            this.Expression = Expression.Constant(this);
            this.Provider   = provider;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="PostgreSqlOrderedQuerableProvider{TResult}"/> class.
        /// </summary>
        /// <param name="provider">The query provider this instance is to be created for</param>
        /// <param name="expression">The expression base for this provider</param>
        public PostgreSqlOrderedQuerableProvider(PostgreSqlQueryProvider provider, Expression expression)
        {
            if (provider == null)
            {
                throw new ArgumentNullException(nameof(provider));
            }

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

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

            this.Expression = expression;
            this.Provider   = provider;
        }