When performing the save of an entity (let's call it Route) I am receiving the following exception:
Hibernate.PropertyAccessException : Exception occurred getter of Project.Domain.Client.Id
System.Reflection.TargetException : Object does not match target type.
I am puzzled by this exception, as I have not loaded any of the entities of the class Client... The only moment when NHibernate accesses the getter of the Client class is when creating the session factory and the subsequent opening of a session object.
The declaration of the identifier for the Client class is trivial, nothing special about it:
<id name="Id" column="Id" access="property" type="Int32">
<generator class="identity" />
What means this error and why could it have been triggered ? How can I solve this problem ?