Path: redb/redb.Templates/templates/redb-bff/RedbBff.Web/Components/Pages/ProductEdit.razor Snapshot: redb, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb Page: https://redbase.app/src/dev-2026-12-06/redb/redb.Templates/templates/redb-bff/RedbBff.Web/Components/Pages/ProductEdit.razor ---- @page "/products/new" @page "/products/{Id:long}" @inject BackendClient Api @inject NavigationManager Navigation @(Id is null ? "New product" : "Edit product")

@(Id is null ? "New product" : "Edit product")

@if (error is not null) {

@error

} @if (product is not null) {
Cancel
} @code { [Parameter] public long? Id { get; set; } private ProductDto? product; private string? error; protected override async Task OnParametersSetAsync() { if (Id is null) { product = new ProductDto(); return; } try { product = await Api.ProductAsync(Id.Value); } catch (BackendException ex) { error = ex.Message; } } private async Task SaveAsync() { try { await Api.SaveProductAsync(product!); Navigation.NavigateTo(""); } catch (BackendException ex) { error = ex.Message; } } }