Пример #1
0
        public IActionResult Delete(int id)
        {
            string type_ = _asset.GetType(id);

            if (type_.Equals("Book"))
            {
                _asset.Remove(id);
                return(RedirectToAction("ListBook"));
            }
            else
            {
                _asset.Remove(id);
                return(RedirectToAction("ListVideo"));
            }
        }
        public IActionResult ConfirmDelete(int id)
        {
            var asset = assets.GetById(id);

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



            assets.Remove(asset);
            assets.Complete();

            return(RedirectToAction("Index", "Catalog"));
        }