Is it possible to setup NHibernate to load/persist a non-public property of a class? For example I may have an Item class as follows.
public class Item
{
public int ItemID {get; set;}
public string Name{get; set;}
}
With the following mapping:
<class name="RCL.Item" table="Items">
<id name="ItemID" type="Int32" column="ItemID">
<generator class="native"/>
</id>
<property name="Author" />
</class>
However I really don't want the consumers of my Item class to be able to change the ItemID field. Can I restrict access to the set accessor of ItemID? If so what should I set it to? Private, protected, internal, protected internal?