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

            NickBase = await _context.NickList.FirstOrDefaultAsync(m => m.Id == id);

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

            NickBase = await _context.NickList.FindAsync(id);

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

            return(RedirectToPage("/MenagePanel/MenageUser/NickNames"));
        }