-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Description
Any particular reason to not include a way specify properties to eager load? Just wondering if there was something wrong with that.. I'm thinking I rather isolate all EF-specifics including the .Includes() calls to the same assembly as my generic repo implementation assembly.
I added params to GetQuery<>() and its overloads:
Queryable<TEntity> GetQuery<TEntity>(params Expression<Func<TEntity, object>>[] pExpandPropertySelectors)
and before return the objectQuery:
if (pExpandPropertySelectors != null)
{
objectQuery = pExpandPropertySelectors.Aggregate
(objectQuery, (pCurrent, pInclude) => pCurrent.Include(pInclude) as ObjectQuery<TEntity>);
}
also modified the GetByKey method to make a call out to DbContext.Entry(entityObject).Reference/Collection.Load() ..
Metadata
Metadata
Assignees
Labels
No labels