/// <summary> /// Eager-loads a projection of the specified queryable, /// referencing a mapped child object. /// </summary> public static IFetchRequest <T, TRel> EagerlyFetchMany <T, TRel>( this IQueryable <T> queryable, Expression <Func <T, IEnumerable <TRel> > > expression) { if (queryable is QueryableBase <T> ) { return(FetchHelper.Create(queryable.FetchMany(expression))); } else { return(FetchHelper.CreateNonNH <T, TRel>(queryable)); } }
/// <summary> /// Eager-loads a second-level projection of the specified queryable, /// referencing a mapped child of the first eager-loaded child. /// </summary> public static IFetchRequest <T, TRel2> ThenEagerlyFetch <T, TRel, TRel2>( this IFetchRequest <T, TRel> queryable, Expression <Func <TRel, TRel2> > expression) { if (queryable is QueryableFetchHelper <T, TRel> ) { return(FetchHelper.CreateNonNH <T, TRel2>(queryable)); } else { return(FetchHelper.Create(queryable.ThenFetch(expression))); } }