This should be pretty simple for you guys. How do I select an object
if a given child is in a collection? Here's the basic look, with ???
where my problem exists. I don't know what Expression to use here.
It's not a matter of simply testing Eq("Value", tag.Value), although I
could. I want to know if there's a simple way to select it if the Tag
is in the post.Tags collection.
/// <summary>
/// Selects all posts based on tag.
/// </summary>
/// <param name="tag">The tag to search on.</param>
/// <returns>IEnumerable%lt;Post></returns>
public IEnumerable<Post> SelectByTag(Tag tag)
{
// select all posts based on tag
return WithTransaction<IEnumerable<Post>>((session) =>
{
return session.CreateCriteria<Post>()
.CreateCriteria("Tags")
.Add(???)
.List<Post>();
});
}
--
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.