private ILiteQueryable <TEntity> Includes(ILiteCollection <TEntity> collection, params Expression <Func <TEntity, IBaseEntity> >[] includes) { if (includes == null) { return(collection.Query()); } ILiteQueryable <TEntity> queryable = collection.Query(); foreach (Expression <Func <TEntity, IBaseEntity> > include in includes) { queryable = queryable.Include(include); } return(queryable); }
public static ILiteQueryable <T> IncludeAll <T>(this ILiteQueryable <T> liteQueryable) where T : class { return(liteQueryable.Include(GetRecursivePaths(typeof(T)))); }
/// <summary> /// Load cross reference documents from path expression (DbRef reference) /// </summary> public ILiteQueryableAsync <T> Include <K>(Expression <Func <T, K> > path) { // Note the wrapped function in LiteDB mutates the ILiteQueryable object _wrappedQuery.Include(path); return(this); }