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

            Product = await _context.Product
                      .Include(p => p.Brand).FirstOrDefaultAsync(m => m.ID == id);

            if (Product == null)
            {
                return(NotFound());
            }
            ViewData["BrandID"] = new SelectList(_context.Set <Brand>(), "ID", "ID");
            return(Page());
        }
Exemple #2
0
 public IActionResult OnGet()
 {
     ViewData["BrandID"] = new SelectList(_context.Set <Brand>(), "ID", "ID");
     return(Page());
 }