Share via


BL0002: il componente ha più parametri CaptureUnmatchedValues

Valore
ID regola BL0002
Categoria Utilizzo
Correzione che causa un'interruzione o un'interruzione Nessuna interruzione

Causa

Più di un parametro in un tipo derivato da ComponentBase viene annotato con CaptureUnmatchedValues = true.

Descrizione regola

Per un componente, è previsto CaptureUnmatchedValues che un parametro sia impostato su true.

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

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

Come correggere le violazioni

Limitare un singolo parametro da CaptureUnmatchedValues impostare.

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

    [Parameter] public Dictionary<string, object> Parameter2 { get; set; }
}

Quando eliminare gli avvisi

Non escludere un avviso da questa regola.