public async Task <IActionResult> DeleteCake(int id) { _cakeRepository.Delete(id); await _unitOfWork.CompleteAsync(); return(Ok()); }
public IActionResult Delete(int id) { var student = studentRepository.Get(id); studentRepository.Delete(id); return(RedirectToAction("ViewDetail", "Home", new { id = student.CategoryId })); }
public ActionResult Delete(Cake cake) { Cake deletedCake = cakeRepository.Delete(cake); if (deletedCake != null) { TempData["Message"] = $"Удаление продукта \"{deletedCake.Name}\" успешно"; } return(RedirectToAction("Index")); }
public async Task <ActionResult> Delete(int id) { await _cakeRepo.Delete(id); if (await _unitOfWork.SaveAll()) { return(Ok()); } return(BadRequest("Failed to delete cake")); }
public IActionResult OnPostDelete(int id) { cakeRepository.Delete(id); return RedirectToPage("/Admin/CakePage/CakeList"); }