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

            Cshop = await _context.Cshop.FirstOrDefaultAsync(m => m.CSID == id);

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

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

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

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