Commit 3151c6a6 authored by vosen's avatar vosen

Even more helpful error message.

parent 6799063c
...@@ -1540,7 +1540,8 @@ static List<FieldInfo> GetSettableFields(Type t) ...@@ -1540,7 +1540,8 @@ static List<FieldInfo> GetSettableFields(Type t)
} }
if (!hasDefaultConstructor && specializedConstructor == null) if (!hasDefaultConstructor && specializedConstructor == null)
{ {
throw new InvalidOperationException(String.Format("Cannot find constructor for type {0}. A parameterless default constructor or one matching order, names and types of values returned by the query is required to allow for dapper materialization", type.FullName)); string proposedTypes = "(" + String.Join(", ", types.Select((t, i) => t.FullName + " " + names[i]).ToArray()) + ")";
throw new InvalidOperationException(String.Format("A parameterless default constructor or one matching signature {0} is required for {1} materialization", proposedTypes, type.FullName));
} }
} }
il.BeginExceptionBlock(); il.BeginExceptionBlock();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment