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

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

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

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

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

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