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

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

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

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

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

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