Nhibernate: Don't fetch when accessing a child objects primary key
- by thermal7
Hi,
Is there a way in NHibernate to get the foreign key of a child object, without fetching the child object?
EG.
I have User and UserRole. Can I access User.UserRole.UserRoleId without causing another hit on the database to retrieve UserRole?
I realize I can set fetch mode to eager and this will stop it from hitting the database again, but…