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

            ParkInfomation = await _context.ParkInfomation.SingleOrDefaultAsync(m => m.Id == id);

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

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

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

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