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