0

使用:
.NET Core 1.1
Dapper.Contrib
Npgsql

在 Postgresql 9.6 上

我正在尝试使用.InsertAsync扩展方法但出现错误:
Cannot apply indexing with [] to an expression of type 'object'

Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: Cannot apply indexing with [] to an expression of type 'object'
   at CallSite.Target(Closure , CallSite , Object , String )
   at CallSite.Target(Closure , CallSite , Object , String )
   at PostgresAdapter.<InsertAsync>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()

如果我使用普通.Insert方法,一切正常。
可能是什么原因?

4

1 回答 1

1

这是一个错误:https ://github.com/StackExchange/Dapper/pull/689

其中,查看问题跟踪器,已修复但未发布。

您可以尝试从最新的源代码构建,或者自己应用特定的修复程序。

于 2017-08-14T12:09:38.143 回答