public async Task Handle(VoterCreated notification, CancellationToken cancellationToken) { var votersCount = await _votersRepository.GetCount(); if (votersCount == 1) { var voter = await _votersRepository.Get(notification.VoterId); if (voter is null) { throw new NullReferenceException( $"cannot get voter in {nameof(GiveAdminRightsOnFirstVoterCreated)}"); } using (_domainEvents.CollectPropertiesChange(voter)) { voter.IsAdministrator = true; } await _domainEvents.PublishCollected(cancellationToken); } }