public IActionResult OnGet(int authorId)
 {
     Author        = catalog.GetAuthorById(authorId);
     Book          = new Book();
     Book.AuthorId = authorId;
     return(Page());
 }
Beispiel #2
0
 public IActionResult OnGet(int?authorId)
 {
     if (authorId.HasValue)
     {
         Author = catalog.GetAuthorById(authorId.Value);
     }
     else
     {
         Author = new Author();
     }
     return(Page());
 }
 public void OnGet(int authorId)
 {
     Author        = catalog.GetAuthorById(authorId);
     Books         = catalog.GetBooksByAuthor(authorId);
     NumberOfBooks = Books.Count();
 }
 public IActionResult OnGet(int authorId)
 {
     Author = catalog.GetAuthorById(authorId);
     return(Page());
 }