Beispiel #1
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            Books = await _apiClient.GetByIdAsync <Entities.Models.Books>(_apiClient.BooksApiMethod, id);

            if (Books == null)
            {
                return(NotFound());
            }

            return(Page());
        }
Beispiel #2
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            Books = await _apiClient.GetByIdAsync <Entities.Models.Books>(_apiClient.BooksApiMethod, id);

            if (Books == null)
            {
                return(NotFound());
            }

            ViewData["Authors"]    = new SelectList(await _apiClient.GetAllAsync <Authors>(_apiClient.AuthorsApiMethod), "Id", "FullName");
            ViewData["Categories"] = new SelectList(await _apiClient.GetAllAsync <Entities.Models.Categories>(_apiClient.CategoriesApiMethod), "Id", "Name");

            return(Page());
        }