public IHttpActionResult Delete([FromUri] int id) { var result = _service.Delete(id); if (!result) { return(BadRequest("Unable to delete entity")); } return(Ok()); }
public IActionResult Delete(int id) { try { _surveyService.Delete(id); return(Ok()); } catch (Exception ex) { return(BadRequest()); } }
public ActionResult SurveyQuestionCreate(SurveyQuestionCreateViewModel surveyQuestionCreateViewModel, int surveyId, int questionId, bool isDeletedSurvey, bool isDeletedQuestion) { surveyQuestionCreateViewModel.SurveyId = surveyId; if (isDeletedQuestion == true) { _questionService.Delete(questionId); } if (isDeletedSurvey == true) { _surveyService.Delete(surveyId); return(RedirectToAction("SurveyCreate")); } surveyQuestionCreateViewModel.Questions = _questionService.GetBySurveyId(surveyId); surveyQuestionCreateViewModel.QuestionResponseOptions = _questionOptionService.GetAll(); return(View(surveyQuestionCreateViewModel)); }
public IActionResult Delete(int id) { _surveyService.Delete(id); return(Ok()); }
// DELETE api/survey/5 public void Delete(string id) { _surveyService.Delete(id); }