public Task Handle(RemoveJogoCommand message, CancellationToken cancellation)
        {
            if (!message.IsValid())
            {
                NotifyValidationErrors(message);
                return(Unit.Task);
            }

            _jogoRepository.Remove(message.Id);

            if (Commit())
            {
                Bus.RaiseEvent(new AmigoRemovedEvent(message.Id));
            }

            return(Unit.Task);
        }
Пример #2
0
        public void Remove(Guid id)
        {
            var removeCommand = new RemoveJogoCommand(id);

            Bus.SendCommand(removeCommand);
        }