【发布时间】:2021-11-22 11:05:42
【问题描述】:
我需要在我的一个 ClassMap 中映射 Dictionary
HasMany(x => x.ExcitationCurve)
.Table("PresetCurveExcitation")
.KeyColumn("PresetCurveId")
.AsMap<TenthNm>("Wavelength")
.Element("Value");
这可行,但 TenthNm 对象存储为 BLOB,它可能只是一个 int。
在其他 ClassMap 中,我只使用了一个 TenthNm 属性
Map(x => x.Wavelength).CustomType<TenthNmUserType>();
TenthNmUserType 是一个实现 IUserType 的类,所以它在那里存储为 int。
但是我如何告诉 NHibernate 使用 TenthNmUserType(或自定义 int 映射)?
【问题讨论】:
标签: c# .net nhibernate nhibernate-mapping fluent-nhibernate-mapping