NHibernate 2.* mapping files: how to define nullable DateTime type (DateTime?)?

家住魔仙堡 提交于 2019-12-01 02:34:35
<property name="CreatedDate" />
  • NHibernate will reflect over the class in question and discover that the property's reflected type is DateTime? all on its own.
  • NHibernate will assume the column name is by default the same as the property name, unless you tell it otherwise.
  • NHibernate will assume that any property is nullable (not-null="false") unless you tell it otherwise.

If you really want, it should be something like ...

<property name="CreatedDate" type="System.Nullable`1[[System.DateTime, mscorlib]], mscorlib" />
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!