I did something similar in a test application recently to see if it
would work.  If you don't mind using LINQ, here's what I did (with the
class names changed to match yours):

session.Query<Post>().Where(myPost => myPost.Tags.Any(t => t.Id ==
tag.Id)).ToList();

On Mar 7, 11:45 am, Wolli <[email protected]> wrote:
> That should work:
>
>  return session.CreateCriteria<Post>("p")
>             .CreateCriteria("p.Tags", "t")
>             .Add(Expression.Eq("t.id", tag )
>             .List<Post>();
>
> You can either pass a "tag" object or an id.

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.

Reply via email to