Commit fcd385fd authored by Sam Saffron's avatar Sam Saffron

test for multi command with a strong type

parent 2706855a
......@@ -226,6 +226,25 @@ public void TestExecuteMultipleCommand()
sum.IsEqualTo(10);
}
class Student
{
public string Name {get; set;}
public int Age { get; set; }
}
public void TestExecuteMultipleCommandStrongType()
{
connection.Execute("create table #t(Name nvarchar(max), Age int)");
int tally = connection.Execute(@"insert #t (Name,Age) values(@Name, @Age)", new List<Student>
{
new Student{Age = 1, Name = "sam"},
new Student{Age = 2, Name = "bob"}
});
int sum = connection.Query<int>("select sum(Age) from #t drop table #t").First();
tally.IsEqualTo(2);
sum.IsEqualTo(3);
}
public void TestExecuteMultipleCommandObjectArray()
{
connection.Execute("create table #t(i int)");
......
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