public RedirectToActionResult RemoveCake(Guid id) { var cake = _CakeRepository.GetCakeById(id); _CakeRepository.RemoveCake(cake); return(RedirectToAction("Index")); }
public RedirectToActionResult RemoveCake(Guid id) { var cake = _CakeRepository.GetCakeById(id); if (cake != null) { _CakeRepository.RemoveCake(cake); return(RedirectToAction("Index")); } else { return(RedirectToAction("NotFoundAction")); } }