예제 #1
0
 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();
     }
 }
예제 #2
0
 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();
     }
 }