I need to map a Dictionary<TenthNm,double> in one of my ClassMaps, but the key is custom type (essentially, TenthNm is an object that has only an int property). There is a similar question, which lead me to this:
HasMany(x => x.ExcitationCurve)
.Table("PresetCurveExcitation")
.KeyColumn("PresetCurveId")
.AsMap<TenthNm>("Wavelength")
.Element("Value");
This works, but the TenthNm object is stored as a BLOB, where it simply could be an int.
In other ClassMaps, with only a single TenthNm property, I use
Map(x => x.Wavelength).CustomType<TenthNmUserType>();
with TenthNmUserType being a class implementing IUserType, so it is stored as an int there.
But how can I tell NHibernate to use TenthNmUserType (or a custom int mapping)?