I wrote an object which included some datetime fields. When the object initializes, the datetime fields are set to System.DateTime.minValue(01/01/0001), this step is done automaticly by asp.net, So when I save the object to database through nhibernate, the value in database will be 01/01/0001. But I just want to set null to the datetime field and also save the null value in database.
in c#.net, someDateTimeField = null is illegal, so what can I do? And even I treat 01/01/0001 as null, I will get into trouble when do some query according to this datetime field by HQL.
|