예제 #1
0
        public async Task <IActionResult> PutWishList(int listId, [FromBody] WishList wishList)
        {
            if (await _wishListBusiness.GetAsync(listId) == null)
            {
                return(NotFound());
            }

            wishList.Id = listId;

            await _wishListBusiness.UpdateAsync(wishList);

            return(NoContent());
        }
예제 #2
0
        public async Task <IActionResult> GetItems(int listId)
        {
            if (await _wishListBusiness.GetAsync(listId) == null)
            {
                return(NotFound());
            }

            IList <Item> items = await _itemBusiness.Query().Where(i => i.WishList.Id == listId).ToListAsync();

            if (items == null)
            {
                return(NotFound());
            }

            return(Ok(items));
        }