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); }
public void Remove(Guid id) { var removeCommand = new RemoveRestaurantCommand(id); Bus.SendCommand(removeCommand); }