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

            dilznost = await _context.dilznost.FirstOrDefaultAsync(m => m.ID == id);

            if (dilznost == null)
            {
                return(NotFound());
            }
            return(Page());
        }
예제 #2
0
        public async Task <IActionResult> OnPostAsync(short?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

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

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

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