ASP0020: Complex types referenced by route parameters must be parsable
Value | |
---|---|
Rule ID | ASP0020 |
Category | Usage |
Fix is breaking or non-breaking | Non-breaking |
Cause
A route parameter is a complex type that isn't parsable.
Rule description
This diagnostic is emitted when a route parameter is a complex type that isn't parsable.
How to fix violations
To fix a violation of this rule, define a bool TryParse(string, IFormatProvider, out T)
method, where T
is the complex type identified in the error message. As an alternative, implement IParsable<TSelf>.
When to suppress warnings
Do not suppress a warning from this rule.
التعاون معنا على GitHub
يمكن العثور على مصدر هذا المحتوى على GitHub حيث يمكنك أيضاً إضافة مشاكل وطلبات سحب ومراجعتها. للحصول على معلومات إضافية، اطلع على دليل المساهم لدينا.
ASP.NET Core
الملاحظات
https://aka.ms/ContentUserFeedback.
قريبًا: خلال عام 2024، سنتخلص تدريجيًا من GitHub Issues بوصفها آلية إرسال ملاحظات للمحتوى ونستبدلها بنظام ملاحظات جديد. لمزيد من المعلومات، راجعإرسال الملاحظات وعرضها المتعلقة بـ