PostgreSQL, Npgsql returning 42601: syntax error at or near “$1”

后端 未结 3 1895
醉酒成梦
醉酒成梦 2021-01-13 19:00

I\'m trying to use Npgsql and/or Dapper to query a table and I keep running into Npgsql.PostgresException 42601: syntax error at or near \"$1\".

Here is

3条回答
  •  梦谈多话
    2021-01-13 19:54

    i got this error using DapperExtensions

    adding

    DapperExtensions.DapperExtensions.SqlDialect = new PostgreSqlDialect();
    DapperAsyncExtensions.SqlDialect = new PostgreSqlDialect();
    

    before creating the connection fixed the issue

提交回复
热议问题