Exemple #1
0
        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());
        }
Exemple #2
0
 public IActionResult OnGet()
 {
     ViewData["CustomerID"] = new SelectList(_context.Set <Customer>(), "Id", "Id");
     return(Page());
 }