I'm working on a case were I normally, in SQL, should have an 'except' keyword. At this moment I didn't found a solution to accomplish this in NHibernate.
It's a solution where you have two tables: The user table and a FK table (including a PK for easy work in NH). The meaning of the SQL below is to give al the records for the users that aren't tagged yet by a certain user. So if we have 3 users: John, Jane en Jelain. If John tagged nobody: give back jane and jelain If John tagged Jane: give back Jelain If John tagged both Jane and Jelain: give back nothing.
SQL to get users that aren't tagged yet:
SELECT Id, DisplayName, Date, ProfilePicUrl
FROM MyDB.dbo.Users u
EXCEPT
SELECT u.Id, Displayname, Date, ProfilePicUrl
FROM MyDB.dbo.Users u
FULL OUTER JOIN MyDB.dbo.TaggedUsers t
ON u.Id=t.TargetId
WHERE
t.ShooterId = '1234' OR
u.Id = '1234'