public void Handle(Command command) { _commandRepository.Add(command); _commandRepository.Commit(); _validator.Validate(command); command.Execute(); if (!_validator.HasValidations()) { _eventBus.Dispatch(); _uoW.Commit(); } }
public override void Execute() { if (_centralValidations.HasValidations()) { return; } var newUserEvent = new UserEvent(DomainEventType.Creation) { Id = Guid.NewGuid(), Name = Name, Login = Login, Email = Email, Password = Password }; _eventBus.AddEvent(newUserEvent); }