@page "/servers/{id:int}" @* Route constraints: https://learn.microsoft.com/en-us/aspnet/core/fundamentals/routing?view=aspnetcore-9.0#route-constraints *@ @inject NavigationManager NavigationManager

Edit server



@if (server != null) {

  Close
} @code { [Parameter] // This is a root parameter. public int Id { get; set; } [SupplyParameterFromForm(FormName = "formServer")] private Server? server { get; set; } protected override void OnParametersSet() { server ??= ServersRepository.GetServerById(this.Id); } private void SubmitServer() { if (server != null) { ServersRepository.UpdateServer(server.Id, server); } // An exception is raised when debugging from VS Code, but not when using dotnet watch. NavigationManager.NavigateTo("/servers"); } }