Map to Serializable in Fluent NHibernate

2019-08-16 19:43发布

问题:

NHibernate has a "Serializable" type

<property name="PropertyName" column="ColumnName" type="**Serializable**"  />

Is there a built in type for this in Fluent NHibernate?

Something like

Map(x => x.PropertyName).CustomType<**SerializableType**>();

??

回答1:

Map(c => c.PropertyName).CustomType<NHibernate.Type.SerializableType>()

seems to do it



回答2:

Map(c => c.PropertyName).CustomType("serializable");