public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } Adres = await _context.Adres.FirstOrDefaultAsync(m => m.AdresId == id); if (Adres == null) { return(NotFound()); } return(Page()); }
public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } Adres = await _context.Adres.FindAsync(id); if (Adres != null) { _context.Adres.Remove(Adres); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }