There is a nice feature in ADO.NET that allows you to send multiple SQL statements to database in one roundtrip and receive results for all statements:
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);
}
Is there a similar feature in Dapper.NET?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…