Nullable date time

Posts   
 
    
Brandt
User
Posts: 142
Joined: 04-Apr-2007
# Posted on: 12-Feb-2008 22:45:37   

I am using the v2.5 december 5th build. I have 3 nullable date time fields in an entity. I fetch the entity from the database then update 2 string fields and then save the entity using a unitOfWork. I have not modified any of the nullable date time fields and I get this error

SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM.

Three exceptions are thrown for each of the three nullable date time fields. Has anyone come across this before.

Brandt
User
Posts: 142
Joined: 04-Apr-2007
# Posted on: 12-Feb-2008 23:16:09   

ok I found the problem.

unitOfWork.AddForSave(deviceToSave, new PredicateExpression(NetworkDeviceFields.UpdatedOn == base.InitialEntityUpdatedDate), false, true);

the base.InitialEntityUpdatedDate was datetime.min