public async Task <IActionResult> OnGetAsync(int id) { if (id > 0) { var npc = await _npcAppService.Get(id); if (npc == null) { ErrorMessage = $"Npc {id} 不存在!"; return(Page()); } Npc = _mapper.Map <NpcInput>(npc); } return(Page()); }
public async Task <IActionResult> OnGetAsync(int id) { if (id > 0) { var npc = await _npcAppService.Get(id); Npc = _mapper.Map <NpcInput>(npc); Scripts = await _npcAppService.GetScripts(id); return(Page()); } else { return(RedirectToPage("/Npc/Index")); } }
public async Task <IActionResult> OnGetAsync(int id) { if (id > 0) { Npc = await _npcAppService.Get(id); if (Npc == null) { ErrorMessage = $"Npc {id} 不存在!"; return(Page()); } return(Page()); } else { return(RedirectToPage("/Npc/Index")); } }