zzzprojects / Dapper-Plus

Dapper Plus - High-Efficient Bulk Actions (Insert, Update, Delete, and Merge) for .NET
https://dapper-plus.net/
380 stars 84 forks source link

Does this support DateOnly/TimeOnly? #142

Closed VictorioBerra closed 3 months ago

VictorioBerra commented 4 months ago

A recent PR to Dapper added support for DateOnly/TimeOnly. Is creating a date field in Microsoft SQL Server + DateOnly in C# supported by zzzprojects Dapper-Plus?

JonathanMagnan commented 4 months ago

Hello @VictorioBerra ,

That's a good question; I know we already support it for our Entity Framework Extensions library, but I'm not sure for Dapper Plus. I will ask my developer to look at it.

Best Regards,

Jon

JonathanMagnan commented 4 months ago

Hello @VictorioBerra ,

Just to let you know that DateOnly and TimeOnly will be supported the next time we release Dapper Plus (normally on Tuesday 26)

Best Regards,

Jon

VictorioBerra commented 4 months ago

That is exciting, thank you! So we can create a MSSQL date col and a DateOnly C# prop and it will all magically work?

JonathanMagnan commented 4 months ago

Yup, as soon as the new version is released.

I didn't test it but my employee told me it could already work with the current version by adding both type this way:

DapperPlusManager.AddCustomSupportedType(typeof(DateOnly));
DapperPlusManager.AddCustomSupportedType(typeof(TimeOnly));

Best Regards,

Jon

JonathanMagnan commented 3 months ago

Hello @VictorioBerra ,

The support to DateOnly and TimeOnly has been added in the version 7.4.0.

Could you test it and let us know if everything is working as expected?

Best Regards,

Jon

VictorioBerra commented 3 months ago

Thank you @JonathanMagnan sorry for the delay, it worked great!