How to break the database access class of a Repository
问题 I have the following tightly coupled database access class (repository), that is hard to unit test: class EmployeesRepository : IEmployeeRepository ... public IEnumerable<Employee> GetAllEmployees() { List<Employee> list = new List<Employee>(); try { string connectionString = _secureConfig.Value.MyDbSetting; string sql = "select id, firstname, lastname, entrydate, email from empoyees"; using SqlConnection connection = new SqlConnection(connectionString); using SqlCommand command = new