/// <summary> /// Overrides the method in QueryHelper to perform the $expands in NHibernate. /// Also populates the ExpandTypeMap that controls lazy initialization and serialization. /// </summary> /// <param name="queryable"></param> /// <param name="expandsQueryString"></param> /// <returns></returns> public override IQueryable ApplyExpand(IQueryable queryable, string expandsQueryString) { if (string.IsNullOrWhiteSpace(expandsQueryString)) return queryable; var session = GetSession(queryable); var fetcher = new NHEagerFetch(session.SessionFactory); queryable = fetcher.ApplyExpansions(queryable, expandsQueryString, expandMap); return queryable; }
/// <summary> /// Performs expands based on the list of strings in queryable.GetIncludes(). /// Also populates the ExpandTypeMap that controls lazy initialization and serialization. /// </summary> /// <param name="queryable"></param> /// <returns></returns> public IQueryable ApplyExpand(IQueryableInclude queryable) { var expands = queryable.GetIncludes(); if (expands == null || expands.Count == 0) return queryable; var session = GetSession(queryable); var fetcher = new NHEagerFetch(session.SessionFactory); var expandedQueryable = fetcher.ApplyExpansions(queryable, expands.ToArray(), expandMap); return expandedQueryable; }
/// <summary> /// Overrides the method in QueryHelper to perform the $expands in NHibernate. /// Also populates the ExpandTypeMap that controls lazy initialization and serialization. /// </summary> /// <param name="queryable"></param> /// <param name="expandsQueryString"></param> /// <returns></returns> public override IQueryable ApplyExpand(IQueryable queryable, string expandsQueryString) { if (string.IsNullOrWhiteSpace(expandsQueryString)) { return(queryable); } var session = GetSession(queryable); var fetcher = new NHEagerFetch(session.SessionFactory); queryable = fetcher.ApplyExpansions(queryable, expandsQueryString, expandMap); return(queryable); }
/// <summary> /// Performs expands based on the list of strings in queryable.GetIncludes(). /// Also populates the ExpandTypeMap that controls lazy initialization and serialization. /// </summary> /// <param name="queryable"></param> /// <returns></returns> public IQueryable ApplyExpand(IQueryableInclude queryable) { var expands = queryable.GetIncludes(); if (expands == null || expands.Count == 0) { return(queryable); } var session = GetSession(queryable); var fetcher = new NHEagerFetch(session.SessionFactory); var expandedQueryable = fetcher.ApplyExpansions(queryable, expands.ToArray(), expandMap); return(expandedQueryable); }