public IActionResult Delete(int id) { var questionType = _service.Get(d => d.Id == id); _service.Delete(questionType); return(Ok()); }
public ActionResult Delete(int id) { try { QuestionTypeService.Delete(id); } catch (NotFoundException) { return(HttpNotFound()); } catch (HasRelationsException) { return(Content("Удаление невозможно.")); } return(RedirectToAction("Index")); }