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

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

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

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

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

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