public async Task Handle(EquipmentDisconnectedNotification notification, CancellationToken cancellationToken)
        {
            await _repository.RemoveConnection(notification.Participant, notification.ConnectionId);

            await _mediator.Send(new UpdateSynchronizedObjectRequest(notification.Participant.ConferenceId,
                                                                     SynchronizedEquipment.SyncObjId(notification.Participant.Id)));
        }
        public async Task <Unit> Handle(InitializeEquipmentRequest request, CancellationToken cancellationToken)
        {
            var connection = new EquipmentConnection(request.ConnectionId, request.Name, request.Devices,
                                                     ImmutableDictionary <ProducerSource, UseMediaStateInfo> .Empty);

            await _repository.SetConnection(request.Participant, connection);

            var isJoined = await _mediator.Send(new CheckIsParticipantJoinedRequest(request.Participant));

            if (!isJoined)
            {
                await _repository.RemoveConnection(request.Participant, connection.ConnectionId);

                throw EquipmentError.ParticipantNotJoined.ToException();
            }

            await _mediator.Send(new UpdateSynchronizedObjectRequest(request.Participant.ConferenceId,
                                                                     SynchronizedEquipment.SyncObjId(request.Participant.Id)));

            return(Unit.Value);
        }