ADO.NET 中有一个很好的功能,它允许您在一次往返中将多个 SQL 语句发送到数据库并接收所有语句的结果:
var command = new SqlCommand("SELECT count(*) FROM TableA; SELECT count(*) FROM TableB;", connection);
using(var reader = command.ExecuteReader())
{
reader.Read();
resultA = reader.GetInt32(0);
reader.NextResult();
reader.Read();
resultB = reader.GetInt32(0);
}
Dapper.NET 中是否有类似的功能?