henkmollema/Dommel

Column Date in Postgres

fernandocristan opened this issue · 1 comments

In my table I have a Date column and the property on the entity is DateTime. I am not able to insert this column in dotnet 6, the following error occurs:

'Cannot write DateTime with Kind=Unspecified to PostgreSQL type 'timestamp with time zone', only UTC is supported'

Apparently the parameter is being sent as datetime (info).

What can I do to adjust this?

I also use the package Dapper.FluentMap.Dommel

I think this issue is not part of Dommel, it just forwards the parameters to Dapper. Perhaps you can use the suggestion of roji as a starting point:

Otherwise you can explicitly set NpgsqlDbType on the parameter to NpgsqlDbType.Date (see Dapper custom parameter types).