Dapper type operator using DynamicParameters

It works:

var list = conn.Query<int>( "select Id from Person where Id in @ids", new { ids = new int[] { 1, 2, 3 } } ); 

This throws "There is no mapping from the type of the System.Int32 [] object to the known type of managed managed provider.":

 DynamicParameters parameters = new DynamicParameters( new { ids = new int[] { 1, 2, 3 } } ); var list2 = conn.Query<int>( "select Id from Person where Id in @ids", parameters ); 

Any ideas?

+6
source share
1 answer

This problem was simply fixed in the last dapper (grab from hg), the code used to deviate from the value of the DynamicParameters value. Now the executable code is the same.

+5
source

Source: https://habr.com/ru/post/892852/


All Articles