Entity framework date/time conversion for sqlserver
I prefer working with DateTime.MinValue
, even if I use SqlServer as backend.
Is it poss开发者_C百科ible to make Entity Framework to convert from DateTime.MinValue
to 1753-01-01
when saving entities and convert back to DateTime.MinValue
when fetching them?
Edit: I do not want to use DateTime?
(nullable value type)
If SQL Server 2008 is an option, you could go with using datetime2 in your database which would allow you to store DateTime.MinValue.
精彩评论