SqlServer 中 字段类型是 Image,在 Nhibernate 中如何映射?
解决如下:
<property name="logo" type="BinaryBlob">
<column name="logo" length="2147483647" sql-type="image" not-null="false"/>
</property>
在 C# 中使用 byte[] 字节数组。
Table 5.5. Large Object Mapping Types
NHibernate Type | .NET Type | Database Type | Remarks |
---|---|---|---|
StringClob | System.String | DbType.String | type=”StringClob” must be specified. |
BinaryBlob | System.Byte[] | DbType.Binary | type=”BinaryBlob” must be specified. Entire field is read into memory. |
Serializable | Any System.Object that is marked with SerializableAttribute. | DbType.Binary | type=”Serializable” should be specified. This is the fallback type if no NHibernate Type can be found for the Property. |