コード例 #1
0
        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);
        }
コード例 #2
0
 public static ILiteQueryable <T> IncludeAll <T>(this ILiteQueryable <T> liteQueryable) where T : class
 {
     return(liteQueryable.Include(GetRecursivePaths(typeof(T))));
 }
コード例 #3
0
 /// <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);
 }