Hello, good morning.
Recently I decided to play with cache in NHibernate 3 and Linq and everything worked fine until I decided to use the Fetch clause and came across a very strange exception, PropertyAccessException, after a lot searching and finding nothing I decided to ask for your help.
Query that works perfectly;
var result = MySession.Query<Company>().Cacheable().ToList();
Query that does NOT work;
var result = MySession.Query<Company>().Cacheable().Fetch(e => e.Employees).ToList();
Output exception: NHibernate.PropertyAccessException: Exception occurred getter of
MyProject.Empresa.Id ---> System.Reflection.TargetException: Object does not match target type.
Do not worry about that "Object does not match target type" mapping is correct, the problem really is with the Cache system and Fetch clause.
Thanks for any help.
NHibernate version: 3.1.0
* Translated by Google, from Portuguese.