I'm using NHibernate with Lambda Extensions and I can't figure out how to phrase a specific kind of query.
My application lets users tag other users in pictures. So there are Picture objects, and each Picture has one or more Tag objects, and each Tag object has one User object.
I'm implementing a search feature. Given a search string, I want to return all Pictures whose Name contains the string or which have any Tags with a User whose Name contains the string.
I don't know how to assemble this query, or whether I need to do it with subqueries or aliases. What would be the proper way to do this?