Skip to content

Why this throws an exception? was this changed? #50516

Answered by Dreamescaper
iam3yal asked this question in General
Discussion options

You must be logged in to vote

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

  private object? Item => UnmatchedValues.TryGetValue("Item", out var item) ? item : null;

  [Parameter(CaptureUnmatchedValues = true)]
  public Dictionary<string, object> UnmatchedValues { get; set; }

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@iam3yal
Comment options

@iam3yal
Comment options

@Dreamescaper
Comment options

Answer selected by iam3yal
@iam3yal
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-blazor Includes: Blazor, Razor Components
2 participants