Why this throws an exception? was this changed? #50516
-
I have a custom grid component and my row and cell components have few parameters that are an implementation details so consumers shouldn't have access to them, I doubt the following approach below changed because based on this post it should work and I tested my grid both in .NET 6 and 7 just a month ago, it worked only now I'm getting an exception: So I made a new Blazor Server App (Empty) project with a simple component with a similar code that worked for my grid before like this:
Only now I'm getting the following exception:
I've used .NET 7.0.307 for this example. Here is the Stack Trace:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
I don't think that was ever a supported scenario. But you probably can do smth like this: public override Task SetParametersAsync(ParameterView parameters)
{
Item = parameters.GetValueOrDefault<object>("Item");
return base.SetParametersAsync(ParameterView.Empty);
} |
Beta Was this translation helpful? Give feedback.
Let me clarify. Maybe it worked before (I haven't checked), it's just that I don't think it was ever the supported scenario that was guarenteed to work. It certainly did fail if there was no such property at all, so it makes sense that behavior matches.
As an alternative, you can do smth like that