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

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

            if (Restrant == null)
            {
                return(NotFound());
            }
            return(Page());
        }
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

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

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

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