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

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

            if (LunchBoxManufacturer == null)
            {
                return(NotFound());
            }
            return(Page());
        }
Exemple #2
0
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

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

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

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