提交 78b0f54d 编写于 作者: M Marc Gravell

Merge 205 from @BrianJolly (conflict: fixup nuspec)

......@@ -5297,7 +5297,8 @@ public ConstructorInfo FindConstructor(string[] names, Type[] types)
var unboxedType = Nullable.GetUnderlyingType(ctorParameters[i].ParameterType) ?? ctorParameters[i].ParameterType;
if (unboxedType != types[i]
&& !(unboxedType.IsEnum && Enum.GetUnderlyingType(unboxedType) == types[i])
&& !(unboxedType == typeof(char) && types[i] == typeof(string)))
&& !(unboxedType == typeof(char) && types[i] == typeof(string))
&& !(unboxedType.IsEnum && types[i] == typeof(string)))
break;
}
......
......@@ -3526,6 +3526,25 @@ public void SO24740733_TestCustomValueHandler()
foo.CategoryRating.Value.IsEqualTo(200);
}
enum SO27024806Enum { Foo, Bar }
private class SO27024806Class
{
public SO27024806Class(SO27024806Enum myField)
{
this.MyField = myField;
}
public SO27024806Enum MyField { get; set; }
}
public void SO27024806_TestVarcharEnumMemberWithExplicitConstructor()
{
var foo = connection.Query<SO27024806Class>("SELECT 'Foo' AS myField").Single();
foo.MyField.IsEqualTo(SO27024806Enum.Foo);
}
public void SO24740733_TestCustomValueSingleColumn()
{
Dapper.SqlMapper.AddTypeHandler(RatingValueHandler.Default);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册