zzzprojects / Dapper-Plus

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

Dapper Plus Support for Other NodaTime Types. #88

Closed carlos0202 closed 3 years ago

carlos0202 commented 3 years ago

Hi guys,

Thanks for all the support previously adding support for LocalDateTime type from NodaTime. It would be very helpful for our project if we can get some other NodaTime Types added to support (LocalDate and Instant) to fit our needs while using the library.

Right now, I'm facing a null value being sent to the database while using other types than LocalDateTime that was added from this issue .

Can we have the other types I mentioned (I know that is hard to have all NodaTime types) or have a way to add own type mappings?

Thanks in advance for all your help.

JonathanMagnan commented 3 years ago

Hello @carlos0202 ,

Since this time, we added a new method that let you add any types that we do not support yet:

such as:

DapperPlusManager.AddCustomSupportedType(typeof(NodaTime.LocalDateTime));
DapperPlusManager.AddCustomSupportedType("NodaTime.LocalDateTime");

Could you try it and let us know if that worked?

Best Regards,

Jon

carlos0202 commented 3 years ago
DapperPlusManager.AddCustomSupportedType(typeof(NodaTime.LocalDateTime));

Hi Jon,

I've tried adding that line of code but Method AddCustomSupportedType is missing. Since which version is this method available?

JonathanMagnan commented 3 years ago

Hello @carlos0202 ,

The method has been added in the latest version released 5 days ago.

So v4.0.1, just right in time for your question ;)

carlos0202 commented 3 years ago

Hello @carlos0202 ,

The method has been added in the latest version released 5 days ago.

So v4.0.1, just right in time for your question ;)

Hi,

Jonathan, I tested with that version and it worked. Closing this, thanks for your help.