Hi there,
I'm using a NullableDateTime property in an object, but oddly enough .NET refuses to set the property during session.createCriteria.List when the database field contains "null" (the exact opposite of what I would expect :) ).
Here's the exception:
Code:
_innerException {"The type System.DateTime can not be assigned to a property of type Nullables.NullableDateTime setter of LearningAlive.Content.ScheduleEnd" } System.Exception
I have referenced the .dll files Nullables.dll and Nullables.Nhibernate.dll in my VS.NET environment. The relevant parts of the class file looks like this:
Code:
using Nullables;
...<snip>...
private NullableDateTime scheduleStart;
private NullableDateTime scheduleEnd;
...<snip>...
public NullableDateTime ScheduleStart
{
get { return scheduleStart;}
set { scheduleStart = value;}
}
public NullableDateTime ScheduleEnd
{
get { return scheduleEnd;}
set { scheduleEnd = value;}
}
The relevant part of the mapping file is:
Code:
<property name="ScheduleStart" column="schedule_start" type="Nullables.NHibernate.NullableDateTimeType, Nullables.NHibernate" />
<property name="ScheduleEnd" column="schedule_end" type="Nullables.NHibernate.NullableDateTimeType, Nullables.NHibernate" />
I've tried using NhibernateContrib .9 and .8.4 and get the same result. I am probably doing something quite dumb so feel free to have a chuckle when you tell me if this is the case.
One other minor question which could be related - if I want to use the Nullables types from Contrib, do I just use the .DLLs from the Contrib package and ignore the same ones from the regular NHibernate package? This is what I'm doing, there's no indication of how to install the contrib files anywhere and the regular NHibernate DLL filenames are the same so I figured that was the way to go.
Do I need to put "using Nullables;" somewhere other than in the class file itself, like maybe in the data access object that is doing the retrieval?