Commit 58fb9c5c authored by Marc Gravell's avatar Marc Gravell

Merge branch 'master' of git@github.com:StackExchange/dapper-dot-net.git

parents 66c8b3f1 36fdd579
......@@ -4251,7 +4251,13 @@ internal static MethodInfo GetPropertySetter(PropertyInfo propertyInfo, Type typ
{
return propertyInfo.DeclaringType == type ?
propertyInfo.GetSetMethod(true) :
propertyInfo.DeclaringType.GetProperty(propertyInfo.Name, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance).GetSetMethod(true);
propertyInfo.DeclaringType.GetProperty(
propertyInfo.Name,
BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance,
Type.DefaultBinder,
propertyInfo.PropertyType,
propertyInfo.GetIndexParameters().Select(p => p.ParameterType).ToArray(),
null).GetSetMethod(true);
}
internal static List<PropertyInfo> GetSettableProps(Type t)
......
......@@ -2290,6 +2290,26 @@ select @A
var item = connection.Query<int>("#TestProcWithIndexer", new ParameterWithIndexer(), commandType: CommandType.StoredProcedure).Single();
}
public class MultipleParametersWithIndexerDeclaringType
{
public object this[object field] { get { return null; } set { } }
public object this[object field, int index] { get { return null; } set { } }
public int B { get; set; }
}
public class MultipleParametersWithIndexer : MultipleParametersWithIndexerDeclaringType
{
public int A { get; set; }
}
public void TestMultipleParametersWithIndexer()
{
var order = connection.Query<MultipleParametersWithIndexer>("select 1 A,2 B").First();
order.A.IsEqualTo(1);
order.B.IsEqualTo(2);
}
public void Issue_40_AutomaticBoolConversion()
{
var user = connection.Query<Issue40_User>("select UserId=1,Email='abc',Password='changeme',Active=cast(1 as tinyint)").Single();
......
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