public IActionResult DeleteComfirmed(int id) { var production = _productionService.GetProductionById(id); _productionService.Delete(production.Id); return(RedirectToAction(nameof(Index))); }
public IActionResult Delete(int id) { if (!UserIsInRole(UserTypeEnum.Admin)) { return(Unauthorized("You are not in role to permit this action")); } _service.Delete(id); return(Ok()); }
public ActionResult Delete(int id) { var existingItem = _service.GetById(id); if (existingItem == null) { return(NotFound()); } _service.Delete(id); return(Ok()); }