コード例 #1
0
        public IActionResult Remove(int id)
        {
            var watchlist = _watchlistRepository.GetWatchlist(id);

            _watchlistRepository.Remove(watchlist);

            _clientNotification
            .AddSweetNotification("Success", "Pet has been removed from watchlist", NotificationType.success);

            return(RedirectToAction(nameof(Index)));
        }
コード例 #2
0
        public IActionResult Remove(int Id)
        {
            if (Id == 0)
            {
                return(Content("Invalid request"));
            }

            try{
                _repository.Remove(_repository.GetWatchlist(Id));
                return(RedirectToAction(nameof(Index)));
            } catch (Exception ex) {
                throw ex;
            }
        }