0

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?

stkxchng
  • 65
  • 5
  • 26

1 Answers1

1

This is a bug: https://github.com/StackExchange/Dapper/pull/689

Which, looking at the issue tracker, is fixed but unreleased.

You could try building from the latest source, or applying just that particular fix yourself.

Owen Pauling
  • 11,349
  • 20
  • 53
  • 64