Using dapper with snowflake connection
Something broke since v2.0.90 when connecting dapper to snowflake. It now thinks all dates/ and datetimes are ascistrings and the snowflake connector is unable to parse the values.
I am not sure if this is a dapper thing, or a snowflake thing, but I do know that downgrading dapper to from 2.0.123 back to 2.0.90 solves the issue. Because of that I think this is a dapper issue.
I know the exception is coming from snowflake, but after debugging the sources, I have found that dapper is providing the wrong datatype for dates and datetime to the Snowflake db connector.
System.NotImplementedException
The method or operation is not implemented.
at Snowflake.Data.Core.SFDataConverter.csharpTypeValToSfTypeVal(DbType srcType, Object srcVal)
at Snowflake.Data.Client.SnowflakeDbCommand.convertToBindList(List1 parameters) at Snowflake.Data.Client.SnowflakeDbCommand.ExecuteInternalAsync(CancellationToken cancellationToken, Boolean describeOnly) at Snowflake.Data.Client.SnowflakeDbCommand.ExecuteDbDataReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken) at Dapper.SqlMapper.QueryAsync[T](IDbConnection cnn, Type effectiveType, CommandDefinition command) in /_/Dapper/SqlMapper.Async.cs:line 418 at FtpService.SnowflakeRepository.GetActivities(DateTime fromDate) in C:\Users\JonWilson\RiderProjects\ApiService\FtpService\SnowflakeRepository.cs:line 33 at ApiServiceTests.FtpServiceTest.DoShit() in C:\Users\JonWilson\RiderProjects\ApiService\ApiServiceTests\FtpServiceTest.cs:line 22 at Xunit.Sdk.TestInvoker1.<>c__DisplayClass48_1.<<InvokeTestMethodAsync>b__1>d.MoveNext() in C:\Dev\xunit\xunit\src\xunit.execution\Sdk\Frameworks\Runners\TestInvoker.cs:line 264