public void Handle(RegisterPlayarCommand command) { using (var session = _sessionFactory.OpenSession()) { var repository = new PlayarRepository(_eventBus); var competition = CompetitionRepository.GetOrCreate(_eventBus); var id = Guid.NewGuid(); repository.Add(new Playar(id, command.Name)); competition.AddPlayer(id); session.SubmitChanges(); } }