public void AddWishListItem(UserId id, WishListItemId wishlistItemId, RestaurantId restoId, string someNotes) { if (_disabled) { throw new AggregateException("Can not add a to the wish list of a disabled user."); } if (MyWishListIsEmpty() || ThatResturantIsNotInMyWishList(restoId)) { ApplyChange(UserEvents.WishListItemAdded(id, wishlistItemId, restoId, someNotes)); } }
protected void When(UserEvents.UserHasNewWishListItem newWishListItem) { Id = new WishListItemId(newWishListItem.WishListItemId); RestoId = new RestaurantId(newWishListItem.RestaurantId); }