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