LINQ query does not honour fetch="join" mapping attribute applied to a set
Description
I have an class "Organisation", this organisation can change it's legal name over time although this is very unlikely. The list of legal names (called responsible legal person) is represented by a set of "ResponsibleLegalPerson".
When fetching organisation data I want to get the names at the same time so set up the mapping as follows
I have an class "Organisation", this organisation can change it's legal name over time although this is very unlikely. The list of legal names (called responsible legal person) is represented by a set of "ResponsibleLegalPerson".
When fetching organisation data I want to get the names at the same time so set up the mapping as follows
<set name="ResponsibleLegalPersons" table="tblTrnRtoResponsibleLegalPerson" cascade="all-delete-orphan" fetch="join" lazy="false">
When I query this data this way the data is eager loaded as expected
IList<Organisation> list = session.CreateCriteria<Organisation>().List<Organisation>();
However using LINQ it is not eager loaded.
IList<Organisation> list = session.Query<Organisation>().ToList();