NHibernate 中处理可空字段的问题

2.01版之后的NHibernate处理可空字段不再需要引入null.nhibernate.dll了

已支持可空类型。

只要按如下配置就不必为可空字段烦恼了

hbm.xml中配置 not-null

 

<property name="LastLoginTime" column="LastLoginTime" type="DateTime" not-null="false"></property>

 

 

model中配置为可空

public virtual DateTime? LastLoginTime { getset; }

 

 

posted @ 2010-02-25 17:46  默蛇  阅读(333)  评论(0编辑  收藏  举报