示例#1
0
        public IActionResult Delete(int id)
        {
            var questionType = _service.Get(d => d.Id == id);

            _service.Delete(questionType);

            return(Ok());
        }
示例#2
0
 public ActionResult Delete(int id)
 {
     try
     {
         QuestionTypeService.Delete(id);
     }
     catch (NotFoundException)
     {
         return(HttpNotFound());
     }
     catch (HasRelationsException)
     {
         return(Content("Удаление невозможно."));
     }
     return(RedirectToAction("Index"));
 }