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

            Gebruiker = await _context.Gebruikers
                        .Include(g => g.Adres).FirstOrDefaultAsync(m => m.GebruikerId == id);

            if (Gebruiker == null)
            {
                return(NotFound());
            }
            return(Page());
        }
示例#2
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            Gebruiker = await _context.Gebruikers
                        .Include(g => g.Adres).FirstOrDefaultAsync(m => m.GebruikerId == id);

            if (Gebruiker == null)
            {
                return(NotFound());
            }
            ViewData["AdresId"] = new SelectList(_context.Adres, "AdresId", "Huisnummer");
            return(Page());
        }
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            Gebruiker = await _context.Gebruikers.FindAsync(id);

            if (Gebruiker != null)
            {
                _context.Gebruikers.Remove(Gebruiker);
                await _context.SaveChangesAsync();
            }

            return(RedirectToPage("./Index"));
        }