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

            Dozenten = await _context.Dozenten.FirstOrDefaultAsync(m => m.DozentId == id);

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

            Dozenten = await _context.Dozenten.FindAsync(id);

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

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