示例#1
0
        public async Task <GroceryList> Delete(GroceryList groceryList)
        {
            var current = await _groceryListRepository.Get(groceryList.Id);

            if (current.UserId != _userService.CurrentUserId)
            {
                throw new UnauthorizedAccessException();
            }

            return(await _groceryListRepository.Delete(groceryList.Id));
        }