public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } Author = await _context.Author .Include(a => a.Customer).FirstOrDefaultAsync(m => m.Id == id); if (Author == null) { return(NotFound()); } ViewData["CustomerID"] = new SelectList(_context.Set <Customer>(), "Id", "Id"); return(Page()); }
public IActionResult OnGet() { ViewData["CustomerID"] = new SelectList(_context.Set <Customer>(), "Id", "Id"); return(Page()); }