这是我的课:
public class TaskLogger : ITaskLogger
{
private readonly IDbConnection _dbConnection;
public TaskLogger(IDbConnection dbConnection)
{
_dbConnection = dbConnection;
}
public void LogTask(int clientId, string taskName)
{
_dbConnection.Execute("insert blah",{clientId,taskName}});
}
}
我们将温莎用于 DI。
是否应将 TaskLogger 声明为 IDisposable,并处置 IDbConnection?