Commit 7910f25b authored by Marc Gravell's avatar Marc Gravell

When using AddDynamicParameters, watch out for duplicate parameters coming from templates

parent 2a94c2b2
This diff is collapsed.
...@@ -1916,6 +1916,16 @@ public void TestWrongTypes_WithWrongTypes() ...@@ -1916,6 +1916,16 @@ public void TestWrongTypes_WithWrongTypes()
item.D.Equals(true); item.D.Equals(true);
} }
public void Test_AddDynamicParametersRepeatedShouldWork()
{
var args = new DynamicParameters();
args.AddDynamicParams(new { Foo = 123 });
args.AddDynamicParams(new { Foo = 123 });
int i = connection.Query<int>("select @Foo", args).Single();
i.IsEqualTo(123);
}
public class ParameterWithIndexer public class ParameterWithIndexer
{ {
public int A { get; set; } public int A { get; set; }
......
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