BL0004: Component parameter should be public
Value | |
---|---|
Rule ID | BL0004 |
Category | Usage |
Fix is breaking or non-breaking | Breaking |
Cause
A property on a type deriving from ComponentBase annotated with [Parameter]
is not public.
Rule description
Component parameters are required to be public and must have a public setter.
@code
{
[Parameter] int Parameter1 { get; set; }
}
How to fix violations
- Make the property and its setter public.
@code
{
[Parameter] public int Parameter1 { get; set; }
}
- If making the property non-public is not possible, consider implementing
SetParametersAsync
manually.
When to suppress warnings
Do not suppress a warning from this rule.
Sadarbojieties ar mums vietnē GitHub
Šī satura avotu var atrast vietnē GitHub, kur varat arī izveidot un pārskatīt problēmas un atgādāšanas pieprasījumus. Lai iegūtu papildinformāciju, skatiet mūsu līdzstrādnieku rokasgrāmatu.