// GET: Dish/Delete/5
 public ActionResult Delete(int id)
 {
     try
     {
         var image = _dishService.GetById(id);
         _imageService.DeleteImage(image.Image);
         _dishService.DeleteById(id);
         return(RedirectToAction(nameof(Index)));
     }catch (Exception e)
     {
         return(Ok(e.Message));
     }
 }
 public IActionResult Delete(int id)
 {
     try
     {
         var image = _dishService.GetById(id);
         _imageService.DeleteImage(image.Image);
         _dishService.DeleteById(id);
         return(Ok("Succefully deleted"));
     }
     catch (Exception e)
     {
         return(BadRequest("Something went wrong"));
     }
 }
예제 #3
0
 public void DeleteDish(string id)
 {
     service.DeleteById(id);
 }