コード例 #1
0
 public IActionResult Delete(MemoryDeleteVM memoryDeleteVM, int id)
 {
     //if(submit-button clicked)
     {
         service.DeleteMemory(memoryDeleteVM, id);
     }
     return(RedirectToAction(nameof(Index)));
 }
コード例 #2
0
        public ActionResult DeleteMemory(int id)
        {
            var service = new MemoryService();

            service.DeleteMemory(id);
            TempData["SaveResult"] = "Your Memory entry was deleted.";

            return(RedirectToAction("Index"));
        }