Esempio n. 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)));
        }
        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;
            }
        }