예제 #1
0
        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));
            }
        }
예제 #2
0
 protected void When(UserEvents.UserHasNewWishListItem newWishListItem)
 {
     Id      = new WishListItemId(newWishListItem.WishListItemId);
     RestoId = new RestaurantId(newWishListItem.RestaurantId);
 }