public IActionResult Details(int id) { var item = _itemsService.ById(id); if (item == null) { return(Redirect(Items_Root_Path)); } return(View(item)); }
public async Task <IActionResult> RemoveItem(DungeonDetailsViewModel model) { var dungeon = _dungeonsService.ById(model.Id); var item = _itemsService.ById(model.ItemId); if (item == null || dungeon == null) { return(Redirect(Dungeons_Root_Path)); } await _dungeonsService.RemoveItem(dungeon, item); return(RedirectToAction("Details", new { id = dungeon.Id })); }
public async Task <IActionResult> RemoveItem(NPCDetailsViewModel model) { var npc = _NPCsService.ById(model.Id); var item = _itemsService.ById(model.ItemId); if (item == null || npc == null) { return(Redirect(NPCs_Root_Path)); } await _NPCsService.RemoveItem(npc, item); return(RedirectToAction("Details", new { id = npc.Id })); }