I'm experimenting with converting my NHibernate mapping files to FluentNHibernate. However, I'm already stuck on my first attempt. Here's a fragment of one XML mapping file:
<class name="Contact" table="tblXContacts">
<id name="_id" column="ContactID" unsaved-value="0" access="field">
<generator class="identity"/>
</id>
The default fluent language of FluentNHibernate wants to force me to use properties. While I do expose a type-safe ContactId property for use within the code, I was never able to get NHibernate to accept this value type as the Id, so my public property constructs a new value type on the fly.
I've found that within my FluentNHibernate ClassMap, I can get access to the IdMapping and manipulate its properties directly (e.g. Name, Access) but there's far less documentation on how to do things outside of the fluent builders. For example, how do I set the column? There is "AddColumn(...)", but it wants a ColumnMapping which is where I start to get lost.