Tomboi88 / dapper-dot-net

Automatically exported from code.google.com/p/dapper-dot-net
Other
0 stars 0 forks source link

Using the like operator with DynamicParameters #48

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
From my question on SO: 
http://stackoverflow.com/questions/6711012/dapper-like-operator-using-dynamicpar
ameters

----------------------------------

This works:

var list = conn.Query<int>(
  "select Id from Person where Id in @ids", 
  new { ids = new int[] { 1, 2, 3 } }
);
This throws "No mapping exists from object type System.Int32[] to a known 
managed provider native type.":

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
);

Original issue reported on code.google.com by tma...@gmail.com on 15 Jul 2011 at 7:45

GoogleCodeExporter commented 8 years ago
fixed now

Original comment by sam.saff...@gmail.com on 5 Sep 2011 at 3:58