Hi, I was wondering if someone could help with an example criteria for nhibernate. I think I've got my head around fairly basic things, like finding records in a given table who's field matches a certain value etc. Where I'm currently tripping up is where you have a table with a foreign key for another table, and attempting to find rows from the first table based on some field in the second table.
As an example...
If I have
tblUser
pk int ID
int CompanyID
string Name
and
tblCompany
pk int ID
string CompanyName
How would I build criteria to retrieve all users that belong to a company with a certain name? I think I understand how to build appropriate mapping files/objects, I just can't figure out how to make the criteria look against subproperties of the initial object.
Any examples woudl be awesome.