BL0003: Component parameter with CaptureUnmatchedValues has the wrong type
Value | |
---|---|
Rule ID | BL0003 |
Category | Usage |
Fix is breaking or non-breaking | Breaking |
Cause
A parameter on a type deriving from ComponentBase annotated with CaptureUnmatchedValues= true
is not assignable from Dictionary<string, object>
Rule description
Parameters annotated with CaptureUnmatchedValues = true
must be able to receive a Dictionary<string, object>
value.
@code
{
[Parameter(CaptureUnmatchedValues = true)] public IDictionary<string, string> Attributes { get; set; }
}
How to fix violations
Change the type of the parameter to either IDictionary<string, object>
or Dictionary<string, object>
@code
{
[Parameter(CaptureUnmatchedValues = true)] public IDictionary<string, object> Attributes { get; set; }
}
When to suppress warnings
Do not suppress a warning from this rule.
Συνεργαστείτε μαζί μας στο GitHub
Μπορείτε να βρείτε την πηγή για αυτό το περιεχόμενο στο GitHub, όπου μπορείτε επίσης να δημιουργήσετε και να εξετάσετε ζητήματα και αιτήματα έλξης. Για περισσότερες πληροφορίες, ανατρέξτε στον οδηγό συνεργατών.
ASP.NET Core
Σχόλια
https://aka.ms/ContentUserFeedback.
Σύντομα διαθέσιμα: Καθ' όλη τη διάρκεια του 2024 θα καταργήσουμε σταδιακά τα ζητήματα GitHub ως μηχανισμό ανάδρασης για το περιεχόμενο και θα το αντικαταστήσουμε με ένα νέο σύστημα ανάδρασης. Για περισσότερες πληροφορίες, ανατρέξτε στο θέμα:Υποβολή και προβολή σχολίων για