コード例 #1
0
        public Wish GetWishByWishId(int id)
        {
            Wish exists = _repo.GetWishByWishId(id);

            if (exists == null)
            {
                throw new Exception("Invalid Id");
            }
            return(exists);
        }
コード例 #2
0
        public string CreateListWish(ListWish newListWish)
        {
            List list = _lrepo.GetListById(newListWish.ListId);

            if (list == null)
            {
                throw new Exception("Invalid Id");
            }
            Wish wish = _wrepo.GetWishByWishId(newListWish.WishId);

            if (wish == null)
            {
                throw new Exception("Invalid Id");
            }
            _repo.CreateListWish(newListWish.ListId, newListWish.WishId, newListWish.UserId);
            return("success");
        }