Hi,
I'm trying to map a private field in my class using NHibernate mapping attributes in C#.
It works fine when I use a public property, but when I switch to the private field belonging to that property I get the following exceptions:
{"Problem trying to set property type by reflection"} >
{"Could not find a getter for property 'user_ID' in class 'HibernateTest.User'"}
Apparently NHibernate.Mappings always explicitly looks for properties.
I also noticed that NHibernate.Mappings seems to ignore the C# entities to which the mapping attributes are added, as if they are simply piled together.
There are numerous mentions on the internet about the ability to map private fields, but I can't find a single example.
Your help is much appreciated.
Regards, Tonn
|