示例#1
0
 //[Route("Remove/{id}")]
 public IActionResult RemoveImage(int id)
 {
     if (_imgService.Delete(id))
     {
         return(RedirectToAction(nameof(Index)));
     }
     return(BadRequest("No image found"));
 }
        public ActionResult DeleteImage(Image OrderPart)
        {
            Image model = imageListDb.Get(OrderPart.Id);

            if (model == null)
            {
                return(View(ViewNameImageNotFound));
            }
            try
            {
                imageListDb.Delete(model);
                return(RedirectToAction(ActionNameDetails + model.OrderId));
            }
            catch
            {
                return(View(model));
            }
        }