public IActionResult Delete(MemoryDeleteVM memoryDeleteVM, int id) { //if(submit-button clicked) { service.DeleteMemory(memoryDeleteVM, id); } return(RedirectToAction(nameof(Index))); }
public ActionResult DeleteMemory(int id) { var service = new MemoryService(); service.DeleteMemory(id); TempData["SaveResult"] = "Your Memory entry was deleted."; return(RedirectToAction("Index")); }