public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } HostConnection = await _context.Host.FindAsync(id); if (HostConnection != null) { _context.Host.Remove(HostConnection); await _context.SaveChangesAsync(); _manager.RemoveHost(HostConnection.Id); } return(RedirectToPage("./Index")); }