public List <Creditos> ConsultarTodo() { SqlDataReader dataReader; List <Credito> creditos = new List <Credito>(); using (var command = _connection.CreateCommand()) { command.CommandText = "Select * from Creditos "; dataReader = command.ExecuteReader(); if (dataReader.HasRows) { while (dataReader.Read()) { Credito credito = DataReaderMapToCreditos(dataReader); Creditos.Add(credito); } } } return(Creditos); }