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

            ItemDetail = await _context.ItemDetails.FindAsync(id);

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

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

            AppUser = await _context.Users.FindAsync(id);

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

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