Hello to all NHibernate gurus!
Given these two classes:
public class User {
long Id;
string Name;
}
public class Project {
long Id;
User Owner;
IList<User> Managers;
...
}
I would like to query using QueryOver (without using the "magic string" aliases) to get all projects that have user1 as Owner OR , as one of the Managers.
I know how separately:
- get projects named user1 as Owner: session.QueryOver <> Project → (). Where (p => p.Owner == user1)
- get as manager: session.QueryOver <> (). JoinAlias (p => p.Managers, () => manager) .Where (() => manager == user1)
but I do not know how to write a disjunction .
If anyone had an idea, that would help me a lot.
Thanks in advance,
Chris