Open Dean-NC opened 3 months ago
Core bits:
DateOnly
and (separately) TimeOnly
<T>
version of GetValue
output
/ inputoutput
parameter values might need loveNote that it requires provider support; it will not work on System.Data.SqlClient
; it should work on recent Microsoft.Data.SqlClient
and NpgSql
@mgravell I use Microsoft.Data.SqlClient
and SQL Server 2019. The issue is only with querying, not inserting.
Here's a tiny project that reproduces it using Dapper 2.1.37, AOT 1.0.31, Microsoft.Data.SqlClient 5.2.1. The table has a Date column, and the DTO a corresponding DateOnly
property.
Run CreateTable.sql
, and in Program.cs change dbName
constant to your db name.
I'd like to use DateOnly since it was added to Dapper 2.1.37, but AOT 1.0.31 throws an error when using it with queries like
IDbConnection.QueryAsync
InvalidCastException: Invalid cast from 'System.DateTime' to 'System.DateOnly'