public IActionResult DeleteQuest(Quest questToDelete) { if (questToDelete == null) { ViewBag.ErrorMessage = "Sorry, there was an error in communication."; return(View($"Error")); } var questToDeleteFromDb = _questDAO.FindOneRecordBy(questToDelete.Id); _questDAO.DeleteRecord(questToDelete.Id); TempData["QuestMessage"] = $"You have deleted the \"{questToDeleteFromDb.Name}\" Quest!"; return(RedirectToAction($"ViewAllQuests", $"Quest")); }
public IActionResult Delete(Group groupToDelete) { _groupDAO.DeleteRecord(groupToDelete.Id); return(RedirectToAction("Index", "Group")); }