Closed royzhang666 closed 1 year ago
Thanks for contacting us. We will investigate this if we hear more similar feedback.
Possibly related to how Guids are interpreted:
I have a Razor component with the following parameter:
[Parameter]
public Guid PropertyId { get; set; }
The component is consumed within a list control (Virtualize)
<Virtualize Items="@SelectedProperties">
<My.Web.Components.PropertyHeader PropertyId="@context.PropertyId"></My.Web.Components.PropertyHeader>
</Virtualize>
context.PropertyId is also a Guid and the code compiles and runs fine, but Visual Studio (2019 Pro) complains (false negative):
Error CS1662 Cannot convert lambda expression to intended delegate type because some of the return types in the block are not implicitly convertible to the delegate return type My.Web C:\Users\xxxxxxxx\source\repos\xxxxxxx\xxxxxx\My.Web\Pages\PropertySearch.razor 1 Active
Error CS1503 Argument 1: cannot convert from 'System.Guid' to 'int' Myreta.Web C:\Users\xxxxxxxx\source\repos\xxxxxxx\xxxxxx\My.Web\Pages\PropertySearch.razor 38 Active
@royzhang666 this has likely been addressed in .NET 8.0, try out the latest build and feel free to reopen the issue if you are still observing this behavior.
Describe the bug
When using the guid RouteConstraint in client-side blazor, the component will be executed with every single mouse click which is in-efficient. This issue does not happen for datetime route constraint.
To Reproduce
@{ Console.WriteLine("test execution"); }
@code { [Parameter] public Guid Id { get; set; } }