public async Task RemoveParticipant(ISessionParticipant participant) { _participants.Remove(participant.GetPrimaryKey()); await Task.WhenAll(_participants.Select( pair => pair.Value.OnParticipantLeave(participant.GetPrimaryKey()) )); }
public async Task AddParticipant(ISessionParticipant participant) { await Task.WhenAll(_participants.Select( pair => pair.Value.OnParticipantJoin(participant.GetPrimaryKey()) )); _participants.Add(participant.GetPrimaryKey(), participant); }