aspnetcore/diagnostics/bl0002.md
| Value | |
|---|---|
| Rule ID | BL0002 |
| Category | Usage |
| Fix is breaking or non-breaking | Non-breaking |
More than one parameter on a type deriving from xref:Microsoft.AspNetCore.Components.ComponentBase is annotated with CaptureUnmatchedValues = true.
For a component, exactly one parameter is expected to have the xref:Microsoft.AspNetCore.Components.ParameterAttribute.CaptureUnmatchedValues set to true.
@code
{
[Parameter(CaptureUnmatchedValues = true)] public Dictionary<string, object> Parameter1 { get; set; }
[Parameter(CaptureUnmatchedValues = true)] public Dictionary<string, object> Parameter2 { get; set; }
}
Limit a single parameter to have CaptureUnmatchedValues set.
@code
{
[Parameter(CaptureUnmatchedValues = true)] public Dictionary<string, object> Parameter1 { get; set; }
[Parameter] public Dictionary<string, object> Parameter2 { get; set; }
}
Do not suppress a warning from this rule.