I'm posting an answer here for myself (if no one else) since I never found it laid out obviously elsewhere in SO. Lost several hours on this.
I wanted to make use of Dapper in the following manner:
await dapper.Connection().QueryAsync<T>(insertSQL, obj);
insertSQL
could be, for example, an insert statement adding date fields into a table record. The obj
object provides those fields' values as parameters.
The problems begin if the dates need to be of type UTC. The database fields are timestamptz, so that's fine. But how does one convince Dapper to send in UTC-aware SQL?
I banged my head on this problem for quite a while.