public IActionResult OnGet(int?Id) { if (Id.HasValue) { Book = bookInMemory.GetBook(Id.Value); Author = authorInMemory.GetAuthor(Id.Value); if (Book == null) { return(RedirectToPage("/Books/ListBooks")); } } else { Book = new Book(); } FullNames = authorInMemory.GetAuthors().Select(x => new SelectListItem { Value = x.Id.ToString(), Text = x.FullName }).ToList(); return(Page()); }
public void OnGet() { Authors = authorInMemory.GetAuthors(); }