What steps will reproduce the problem?
1. Have a class with multiple constructors
(at least a default (no parameters) and another one with the same parameter types and names and order of the fields on table)
2. var x = cn.Query<table1_class>("SELECT * FROM table1");
3. x is IEnumerable<table1_class> as expected, but objects were created with
the default constructor()
What is the expected output? What do you see instead?
objects created with a parameterized constructor(field1, field2, field3, ...)
What version of the product are you using? On what operating system?
8b405c70e67b - Win7
Please provide any additional information below.
in Dapper.DefaultTypeMap.FindConstructor(string[] names, Type[] types), between
the two first lines of code (between "var constructors" and "foreach()") you
can put the following code:
var exactMatch = constructors.Where(c => {
var pars = c.GetParameters();
return pars.Select(p => p.ParameterType).SequenceEqual(types) &&
pars.Select(p => p.Name).SequenceEqual(names, StringComparer.OrdinalIgnoreCase);
}).SingleOrDefault();
if(exactMatch != null)
return exactMatch;
I hope it helps
Original issue reported on code.google.com by djcha...@gmail.com on 17 Dec 2012 at 6:14
Original issue reported on code.google.com by
djcha...@gmail.com
on 17 Dec 2012 at 6:14