Need some help with a NHibernate Query
Posted
by cwap
on Stack Overflow
See other posts from Stack Overflow
or by cwap
Published on 2010-06-07T14:36:16Z
Indexed on
2010/06/07
15:52 UTC
Read the original article
Hit count: 163
nhibernate
|query
Hi all
Say I got 3 entities: Business, Employee and Payment. A payment has a foreign key to an Employee, while the Employee has an foreign key to a business.
Now, I want to create a query which gives me all payments for a given business. I really don't have a clue about how to do this - I guess I want something like:
mySession.CreateCriteria<Payment>()
.Add(Criterion.Expression.Eq(/* Employee_FK => Employee.Business_FK == BusinessID */);
Any help would be greatly appreciated :)
© Stack Overflow or respective owner