public IActionResult DeleteArticle(string id) { var knowledgebaseArticle = _knowledgebaseService.GetKnowledgebaseArticle(id); if (knowledgebaseArticle == null) { return(RedirectToAction("List")); } if (ModelState.IsValid) { _knowledgebaseViewModelService.DeleteKnowledgebaseArticle(knowledgebaseArticle); SuccessNotification(_localizationService.GetResource("Admin.ContentManagement.Knowledgebase.KnowledgebaseArticle.Deleted")); return(RedirectToAction("List")); } ErrorNotification(ModelState); return(RedirectToAction("EditArticle", new { knowledgebaseArticle.Id })); }
public async Task <IActionResult> DeleteArticle(string id) { var knowledgebaseArticle = await _knowledgebaseService.GetKnowledgebaseArticle(id); if (knowledgebaseArticle == null) { return(RedirectToAction("List")); } if (ModelState.IsValid) { await _knowledgebaseViewModelService.DeleteKnowledgebaseArticle(knowledgebaseArticle); Success(_translationService.GetResource("Admin.Content.Knowledgebase.KnowledgebaseArticle.Deleted")); return(RedirectToAction("List")); } Error(ModelState); return(RedirectToAction("EditArticle", new { knowledgebaseArticle.Id })); }