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

            vid = await _context.Vid.FirstOrDefaultAsync(m => m.ID == id);

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

            Vid = await _context.Vid.FirstOrDefaultAsync(m => m.ID == id);

            if (Vid == null)
            {
                return(NotFound());
            }
            Class = await _context.Class.Where(m => m.vidID == Vid.ID).ToListAsync();

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

            vid = await _context.Vid.FindAsync(id);

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

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