这是我自己的助手的代码片段,但它有一些错误。
/// <summary>
/// Execute a command that returns multiple result sets, and access each in turn
/// </summary>
public static SqlMapper.GridReader QueryMultiple(string sql, dynamic param = null, string connectionName = null)
{
using (SqlConnection connection = GetOpenConnection(connectionName))
{ return connection.QueryMultiple(sql, param);}
}
QueryMultiple 由外部程序手动调用和关闭。不久之后,SqlConnection 应该会自动关闭,如何包装我的助手?提前致谢。