public async Task <IActionResult> OnGetAsync()
        {
            if (Id == 0)
            {
                TempData.Warning("Treasure Id can't be null!");
                return(RedirectToPage("./Index"));
            }

            try
            {
                Input = await _client.GetAsync <Treasure, int>(Id);

                return(Page());
            }
            catch (Exception e)
            {
                TempData.Danger(e.Message);
            }

            return(RedirectToPage("./Index"));
        }
Beispiel #2
0
        public async Task <IActionResult> OnGetAsync()
        {
            if (string.IsNullOrWhiteSpace(Id))
            {
                TempData.Warning("Player Id can't be null!");
                return(RedirectToPage("./Index"));
            }

            try
            {
                Input = await _client.GetAsync <Player, string>(Id);

                return(Page());
            }
            catch (Exception e)
            {
                TempData.Danger(e.Message);
            }

            return(RedirectToPage("./Index"));
        }