Using EF 6. I have an entity (Person
) that contains a nullable datetime field.
public DateTime? StartDate { get; set; }
This made me think I should be able to assign null
to this property without any issue, like this ...
Person.StartDate = null;
However, when I get to context.SaveChanges()
I get an error saying ...
The conversion of a datetime2 data type to a datetime data type resulted in an out-of-range value.\r\nThe statement has been terminated."
Shouldn't a nullable field be able to accept .... null
?