Dapper.contrib Insert - Cannot apply indexing with [] to an expression of type 'object'

时间:2017-08-04 12:00:57

标签: npgsql dapper-contrib

Using:
.NET Core 1.1
Dapper.Contrib
Npgsql

On Postgresql 9.6

I am trying to use .InsertAsync extension method but getting error:
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()

If I use normal .Insert method, everything works OK.
What could be the cause?

1 个答案:

答案 0 :(得分:1)

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

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

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