plmce2005 / dapper-dot-net

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

list support does not support ansi (DbString[]) #71

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
The dapper supports both list parameters and ansi strings, but if I have a list 
parameter of ansi string, then it will fail.

ex: conn.Query<int>("select f1 from t1 where f1 in @f1s",
 new { f1s = new DbString[] { new DbString { IsAnsi = true, ...}, ... }});

then it will throw ArgumentException: No mapping exists from object type 
Dapper.DbString to a known managed provider native type.

It seems a bug in PackListParameters function, if the input is 
IEnumerable<DbString>, it should call (item as DbString).AddParameter instead 
just set listParam.Value to item.

Original issue reported on code.google.com by bigsan.c...@gmail.com on 10 Nov 2011 at 10:49

GoogleCodeExporter commented 8 years ago
fixed in latest

Original comment by sam.saff...@gmail.com on 19 Dec 2011 at 1:39