public IActionResult DeleteConfirmed(int id)
        {
            var _ctxCupcakeToDelete = _repository.GetCupcakeById(id);

            //_repository.DeleteCupcake(_ctxCupcakeToDelete.CupcakeId);
            _repository.DeleteCupcake(id);
            return(RedirectToAction(nameof(Index)));
        }
Exemple #2
0
 public IActionResult DeleteConfirmed(int id)
 {
     try
     {
         _repository.DeleteCupcake(id);
     }
     catch (InvalidOperationException)
     {
         return(NotFound());
     }
     return(RedirectToAction(nameof(Index)));
 }
Exemple #3
0
 public IActionResult DeleteConfirmed(int id)
 {
     _repository.DeleteCupcake(id);
     return(RedirectToAction(nameof(Index)));
 }