After playing around for quite some time, I have the following working, 
it's close enough to what I believe is acceptable, but I still think there 
may be some improvement:
 
public Forum LoadById(int id)
{ 

> var forum = session.CreateCriteria<Forum>()
> .SetFetchMode("topics", FetchMode.Join)
> .Add(Restrictions.Eq("Id",id))
> .FutureValue<Forum>();
>
> var topics = session.CreateCriteria<Topic>()
> .SetFetchMode("posts", FetchMode.Join)
> .Add(Restrictions.Eq("Forum.Id", id))
> .Future<Topic>();
>
> var posts = session.CreateCriteria<Post>()
> .SetFetchMode("User", FetchMode.Eager)
> .SetFetchMode("children", FetchMode.Join)
> .Add(Restrictions.Eq("Forum.Id",id))
> .Future<Post>();
>
> return forum.Value;
>
} 

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/nhusers.
For more options, visit https://groups.google.com/d/optout.

Reply via email to