Exemple #1
0
        public Task <Unit> Handle(RemoveRestaurantCommand message, CancellationToken cancellationToken)
        {
            if (!message.IsValid())
            {
                NotifyValidationErrors(message);
                return(Unit.Task);
            }

            _restaurantRepository.Remove(message.Id);

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

            return(Unit.Task);
        }
Exemple #2
0
        public void Remove(Guid id)
        {
            var removeCommand = new RemoveRestaurantCommand(id);

            Bus.SendCommand(removeCommand);
        }