-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Closed
Labels
area-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor ComponentsbugThis issue describes a behavior which is not expected - a bug.This issue describes a behavior which is not expected - a bug.feature-model-binding
Milestone
Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
After migrating from .net7 to .net8 I encountered an issue that properties with [SupplyParameterFromQuery] not being set druing the OnInitializedAsync only after OnParametersSetAsync.
Ex of the bug:
Navigation with: https://localhost:44340/test?CrumbTrailItemId=662f20c8-b7c1-4145-a8cd-ad693913414a
[SupplyParameterFromQuery]
public string CrumbTrailItemId { get; set; }
protected async Task OnInitializedAsync()
{
// this.CrumbTrailItemId is null
}
protected async Task OnParametersSetAsync()
{
// this.CrumbTrailItemId is "662f20c8-b7c1-4145-a8cd-ad693913414a"
}
Expected Behavior
The property with annotation SupplyParameterFromQuery should be set at the beginning of the life cycle of the component but somehow its being set after OnParametersSetAsync.
Ex of expected behavior:
Navigation with: https://localhost:44340/test?CrumbTrailItemId=662f20c8-b7c1-4145-a8cd-ad693913414a
[SupplyParameterFromQuery]
public string CrumbTrailItemId { get; set; }
protected async Task OnInitializedAsync()
{
// this.CrumbTrailItemId is "662f20c8-b7c1-4145-a8cd-ad693913414a"
}
Steps To Reproduce
Exceptions (if any)
.NET Version
8.0.0
Anything else?
none
Metadata
Metadata
Assignees
Labels
area-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor ComponentsbugThis issue describes a behavior which is not expected - a bug.This issue describes a behavior which is not expected - a bug.feature-model-binding
Type
Projects
Status
Done