public IActionResult VocabularyDeleteAjax(int id) { if (id <= 0) { return(Json(new { success = false, responseText = "Vocabulary is invalid" })); } Vocabulary vocabulary = _VocabularyManager.Get(id); if (vocabulary == null) { return(Json(new { success = true, category = "", responseText = "Deleted" })); } _VocabularyManager.Delete(vocabulary); return(Json(new { success = true, category = "", responseText = "Deleted" })); }