MoonStorm / FastCrud

fast .NET ORM for strongly typed people
MIT License
506 stars 128 forks source link

Support for DateOnly and TimeOnly #197

Closed MoonStorm closed 5 months ago

MoonStorm commented 6 months ago

Discussed in https://github.com/MoonStorm/FastCrud/discussions/196

Originally posted by **kevingolding2001** April 1, 2024 This is a fantastic library that has made my code so much simpler by utilizing generics ie. (InsertAsync(record);) However it seems it does not work with some DotNet and Postgresql types. I've tried using DateOnly and TimeOnly in my C# code, and using the Postgresql equivalents of date and time in the database, but I'm getting null values passed through when trying to insert a new record. What would be required to add support for DateOnly and TimeOnly? Comments elsewhere suggest that the actual mapping is not done in this library, but it relies on Dapper for this. I've already confirmed that these types work in the latest pre-release version of Dapper if I explicitly create the sql statement. Does this mean it is as simple as adding something to the _simpleSqlTypes type array? If there is more to it than that, what is it and how can I contribute?
MoonStorm commented 5 months ago

Added support for these two types however some providers still won't handle them well. Check the discussion thread #196 for more details.