SapientGuardian / mysql-connector-net-netstandard

ADO.NET driver for MySQL targeted against netstandard 1.3
GNU General Public License v2.0
46 stars 15 forks source link

MySql DateTime 0000-xx-xx xx:xx.xx #25

Closed eByte23 closed 8 years ago

eByte23 commented 8 years ago

With MySql its possible to have a daetime field that has a zero year.

When using an orm this doesn't map to datetime as lowest year in .net is 0001. Should I Convert my date in query or should MySQL driver alter this to be 0001 when mapping to .net datetime type *NOTE: This is existing in original driver.

IntelOrca commented 8 years ago

Its probably not a good idea to change this. In my own code I just have a function which will exchange the minimum MySql datetime with DateTime.MinValue and the maximum MySql with DateTime.MaxValue.

eByte23 commented 8 years ago

@IntelOrca cool! wasn't sure what people were doing to get around this I'll just make a custom mapper for the datetime.

Cheers!