Esempio n. 1
0
        public IActionResult OnPost(int movieId)
        {
            Movie = _movieData.Delete(movieId);
            _movieData.Commit();

            if (Movie == null)
            {
                return(RedirectToPage("./NotFound"));
            }

            return(RedirectToPage("./List"));
        }
        public IActionResult OnPost(int movieId)
        {
            var movie = movieData.Delete(movieId);

            movieData.Commit();

            if (movie == null)
            {
                return(RedirectToPage("./NotFound"));
            }
            TempData["Message"] = $"{movie.Name} deleted";
            return(RedirectToPage("./Index"));
        }
        public IActionResult OnPost(int movieId)
        {
            var movie = _movieData.Delete(movieId);

            if (movie is null)
            {
                return(RedirectToPage("./NotFound"));
            }

            _movieData.Commit();

            TempData["Message"] = $"{movie.Title} deleted";
            return(RedirectToPage("./List"));
        }
 public ActionResult Delete(int id, IFormCollection form)
 {
     db.Delete(id);
     TempData["Message"] = "You have deleted the movie!";
     return(RedirectToAction("Index"));
 }
Esempio n. 5
0
 public ActionResult Delete(int id)
 {
     movieData.Delete(id);
     movieData.Commit();
     return(NoContent());
 }
Esempio n. 6
0
 public ActionResult DeleteConfirmed(int id)
 {
     _db.Delete(id);
     return(RedirectToAction("Index"));
 }
Esempio n. 7
0
 public void Delete(int id)
 {
     _movieData.Delete(id);
 }
Esempio n. 8
0
 public IActionResult OnPost(int id)
 {
     movieData.Delete(id);
     TempData["ActionMessage"] = "Deleted a movie";
     return(RedirectToPage("./List"));
 }