public static IFetchedQuery <TEntity, TProperty> Fetch <TEntity, TProperty>( this IQuery <TEntity> query, Expression <Func <TEntity, TProperty> > selector) { var result = new FetchedQuery <TEntity, TProperty>((Query)query) { Parameters = new FetchParameter( typeof(TEntity), typeof(TEntity), selector, QueryType.Fetch, typeof(TProperty)) }; return(result); }
public static IFetchedQuery <TEntity, TProperty> ThenFetch <TEntity, TParent, TProperty>( this IFetchedQuery <TEntity, IEnumerable <TParent> > query, Expression <Func <TParent, TProperty> > selector) { var result = new FetchedQuery <TEntity, TProperty>((Query)query) { Parameters = new ThenFetchParameter( typeof(TEntity), typeof(TEntity), selector, QueryType.ThenFetch, typeof(TProperty), typeof(TParent), typeof(TEntity), true) }; return(result); }