Esempio n. 1
0
        // <inheritdoc />
        public override DbQuery Include(string path)
        {
            // We need this because the Code Contract gets compiled out in the release build even though
            // this method is effectively on the public surface because it overrides the abstract method on DbSet.
            Check.NotEmpty(path, "path");

            return(new InternalDbQuery <TElement>(_internalQuery.Include(path)));
        }
Esempio n. 2
0
        /// <summary>
        ///     Specifies the related objects to include in the query results.
        /// </summary>
        /// <remarks>
        ///     Paths are all-inclusive. For example, if an include call indicates Include("Orders.OrderLines"), not only will
        ///     OrderLines be included, but also Orders.  When you call the Include method, the query path is only valid on
        ///     the returned instance of the DbQuery
        ///     <T>
        ///         . Other instances of DbQuery
        ///         <T>
        ///             and the object context itself are not affected.
        ///             Because the Include method returns the query object, you can call this method multiple times on an DbQuery
        ///             <T>
        ///                 to
        ///                 specify multiple paths for the query.
        /// </remarks>
        /// <param name="path"> The dot-separated list of related objects to return in the query results. </param>
        /// <returns>
        ///     A new DbQuery <T>with the defined query path.
        /// </returns>
        public DbQuery <TResult> Include(string path)
        {
            Check.NotEmpty(path, "path");

            return(new DbQuery <TResult>(_internalQuery.Include(path)));
        }
        /// <summary>
        /// Specifies the related objects to include in the query results.
        /// </summary>
        /// <remarks>
        /// Paths are all-inclusive. For example, if an include call indicates Include("Orders.OrderLines"), not only will
        /// OrderLines be included, but also Orders.  When you call the Include method, the query path is only valid on
        /// the returned instance of the DbQuery&lt;T&gt;. Other instances of DbQuery&lt;T&gt; and the object context itself are not affected.
        /// Because the Include method returns the query object, you can call this method multiple times on an DbQuery&lt;T&gt; to
        /// specify multiple paths for the query.
        /// </remarks>
        /// <param name="path"> The dot-separated list of related objects to return in the query results. </param>
        /// <returns>
        /// A new <see cref="DbQuery{T}" /> with the defined query path.
        /// </returns>
        public virtual DbQuery <TResult> Include(string path)
        {
            Check.NotEmpty(path, "path");

            return(_internalQuery == null ? this : new DbQuery <TResult>(_internalQuery.Include(path)));
        }