public IActionResult EditQuest(Quest questToEdit) { if (ModelState.IsValid && questToEdit != null) { _questDAO.UpdateRecord(questToEdit); TempData["QuestMessage"] = $"You have updated the \"{questToEdit.Name}\" Quest!"; return(RedirectToAction($"ViewAllQuests", $"Quest")); } Response.StatusCode = 406; ViewBag.ErrorMessage = "Sorry, editing this Quest failed."; _logger.LogError($"Could not add the Quest to Db. Quest was null or Invalid"); return(View($"Error")); }
public IActionResult Edit(Group group) { _groupDAO.UpdateRecord(group); return(RedirectToAction("Index", "Group")); }