Dapper.contrib 插入 - 无法将带有 [] 的索引应用于类型为"对象"的表达式



使用:
.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方法,一切正常,
原因可能是什么?

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

查看问题跟踪器,这是固定的但未发布。

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

最新更新