public ActionResult DeleteConfirmed(int id)
    {
        Pizza pizza = _context.FindPizzaById(id);

        _context.Delete <Pizza>(pizza);
        _context.SaveChanges();
        return(RedirectToAction("All", "Pizza"));
    }
Exemple #2
0
    //[Authorize(Roles = "Admin")]
    public ActionResult Delete(int id)
    {
        Dodatek dodatek = _context.FindDodatekById(id);

        if (dodatek == null)
        {
            return(HttpNotFound());
        }
        _context.Delete(dodatek);
        _context.SaveChanges();
        return(RedirectToAction("Index", "Dodatek"));
    }