There are 2 routes to my .NET 8 razor page:
https://localhost:7215/DemoForm/30030443-2b0c-4b94-959d-fb6132dc164f
https://localhost:7215/DemoInfo?oid=30030443-2b0c-4b94-959d-fb6132dc164f
Demo.razor:
@page "/DemoForm/{rowguid:guid}"@page "/DemoInfo"@rendermode InteractiveServer<h3>Demo</h3><h1>Rowguid is @Rowguid</h1>@code { [Parameter, SupplyParameterFromQuery(Name = "oid")] public Guid Rowguid { get; set; }}I expect both results to be:
Rowguid is 30030443-2b0c-4b94-959d-fb6132dc164fHowever, URL 1 returns:
Rowguid is 00000000-0000-0000-0000-000000000000URL 2 returns the expected result
Rowguid is 30030443-2b0c-4b94-959d-fb6132dc164fIf I change Demo.razor to
@page "/DemoForm/{rowguid:guid}"@page "/DemoInfo"@rendermode InteractiveServer<h3>Demo</h3><h1>Rowguid is @Rowguid</h1><h1>_oid is @_oid</h1>@code { [Parameter] public Guid Rowguid { get; set; } [SupplyParameterFromQuery(Name = "oid")] public Guid? _oid { get; set; } protected override Task OnInitializedAsync() { Rowguid = _oid ?? Rowguid; return base.OnInitializedAsync(); }}Rowguid will have the correct results for both URLs.
So what am I missing here?