Reputation:
Is there a way to automagically map a DateTime.MinValue
to a null value in the data layer and vice-versa?
I am trying out EF6. I want to eventually target SQL Server 2005 servers, so the DATETIME2
type is something I want to avoid.
Upvotes: 0
Views: 890
Reputation: 31610
EF does not support mapping min/max/specific values to null through mapping/fluent API. You could override SaveChanges()
and inspect/update entities on save but it would be more involved
Upvotes: 1
Reputation: 1557
There two way to solve it:
Upvotes: 0