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

            Establishment = await _context.Establishment
                            .Include(e => e.Category).FirstOrDefaultAsync(m => m.Id == id);

            if (Establishment == null)
            {
                return(NotFound());
            }
            ViewData["CategoryId"] = new SelectList(_context.Set <Category>(), "Id", "Name");
            return(Page());
        }
Beispiel #2
0
 public IActionResult OnGet()
 {
     ViewData["CategoryId"] = new SelectList(_context.Set <Category>(), "Id", "Name");
     return(Page());
 }