コード例 #1
0
        public IHttpActionResult Delete([FromUri] int id)
        {
            var result = _service.Delete(id);

            if (!result)
            {
                return(BadRequest("Unable to delete entity"));
            }
            return(Ok());
        }
コード例 #2
0
 public IActionResult Delete(int id)
 {
     try
     {
         _surveyService.Delete(id);
         return(Ok());
     }
     catch (Exception ex)
     {
         return(BadRequest());
     }
 }
コード例 #3
0
        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));
        }
コード例 #4
0
 public IActionResult Delete(int id)
 {
     _surveyService.Delete(id);
     return(Ok());
 }
コード例 #5
0
 // DELETE api/survey/5
 public void Delete(string id)
 {
     _surveyService.Delete(id);
 }