Ejemplo n.º 1
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

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

            if (CvrEntry == null)
            {
                return(NotFound());
            }
            return(Page());
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

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

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

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