I know one of the breaking changes with NHibernate 2.* is that the NHibernate.Nullables are no longer supported. Therefore, what do you use in your mapping file to map the nullable DateTime? type? For i.e.:
Understandably doesn't work:
<property name="CreateDate" column="CreateDate" type="DateTime?" not-null="false" />
And no longer supported:
<property name="ModifiedDate" column="ModifiedDate" type="Nullables.NHibernate.NullableDateTimeType, Nullables.NHibernate" not-null="false"/>
I know it must be so obvious, but I'm not finding it!
Answer is as simple as: NHibernate will reflect over the class in question and discover that the property's reflected type is DateTime? all on its own.
Thanks @Justice!
<property name="CreatedDate" />
DateTime?
all on its own.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" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With