Пример #1
0
        public async Task <IActionResult> DeleteCake(int id)
        {
            _cakeRepository.Delete(id);
            await _unitOfWork.CompleteAsync();

            return(Ok());
        }
Пример #2
0
        public IActionResult Delete(int id)
        {
            var student = studentRepository.Get(id);

            studentRepository.Delete(id);

            return(RedirectToAction("ViewDetail", "Home", new { id = student.CategoryId }));
        }
Пример #3
0
        public ActionResult Delete(Cake cake)
        {
            Cake deletedCake = cakeRepository.Delete(cake);

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