Ejemplo n.º 1
0
        public async Task <IActionResult> DeleteCake(int id)
        {
            _cakeRepository.Delete(id);
            await _unitOfWork.CompleteAsync();

            return(Ok());
        }
Ejemplo n.º 2
0
        public IActionResult Delete(int id)
        {
            var student = studentRepository.Get(id);

            studentRepository.Delete(id);

            return(RedirectToAction("ViewDetail", "Home", new { id = student.CategoryId }));
        }
Ejemplo n.º 3
0
        public ActionResult Delete(Cake cake)
        {
            Cake deletedCake = cakeRepository.Delete(cake);

            if (deletedCake != null)
            {
                TempData["Message"] = $"Удаление продукта \"{deletedCake.Name}\" успешно";
            }
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 4
0
        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");
 }