public ActionResult DeletePost(int?id, QuestionRedirectServiceModel model) { if (id == null || model.QuestionId == null) { return(BadRequest()); } if (model.Page == null || model.Page < 1) { model.Page = 1; } bool success = this.commentService.Delete(id.Value); if (!success) { return(BadRequest()); } TempData.AddSuccessMessage(string.Format( WebConstants.SuccessfullEntityOperation, Comment, WebConstants.Deleted)); return(RedirectToAction( Details, Questions, new { id = model.QuestionId, model.Page, area = string.Empty })); }
public ActionResult Delete(int?id, int?questionId, int?page) { if (id == null || questionId == null) { return(BadRequest()); } if (page == null || page < 1) { page = 1; } QuestionRedirectServiceModel model = new QuestionRedirectServiceModel(); model.Page = page; model.QuestionId = questionId; return(View(model)); }