Reputation: 2352
Does Dapper.NET support executing multiple Stored Procedures at once? I have several SPs each with different set of parameters. I want to send a single call to SQL Server to execute all the SPs. Each SP returns multiple records.
Thanks
Upvotes: 4
Views: 3036
Reputation: 1062780
Yes:
using(var multi = conn.QueryMultiple(
@"exec foo @a, @b;
exec bar @a, @c", args))
{
var foos = multi.Read<Foo>().ToList();
var bars = multi.Read<Bar>().ToList();
}
(code is from memory; apologies for any minor typos)
Upvotes: 6