using System.Collections.Generic;
.ToDictionary(connection => connection, connection => GetSessions(connection))
var connection = pair.Key;
var sessions = pair.Value;
sessions.ForEach(session => TerminateConnectionSession(session, connection));
private void TerminateConnectionSession(Session session, Connection connection)
private List<Connection> GetConnections()
private List<Session> GetSessions(Connection connection)
return connection.GetSessions();
public List<Session> GetSessions()