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

            PaperProduct = await _context.paperProduct.SingleOrDefaultAsync(m => m.ID == id);

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

            PaperProduct = await _context.paperProduct.FindAsync(id);

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

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