dotnet / dotnet/dotnet-api-docs
MessageProperties.Item[string] can throw, but documentation claims null is returned
- Vorherrschende Sprache
- C#
- Sterne
- 949
- Forks
- 1.7k
- Ø Merge
- 2 T. 19 Std.
- Gemergte PRs (30 T.)
- 52
Beschreibung
In the documentation for `MessageProperties.Item[string]`, it is claimed that:
> The property with the specified name, or null if the property does not exist.
This is incorrect. The code will throw an exception if the property does not exist. This is not mentioned in the documentation.
Rendered documentation:
https://learn.microsoft.com/en-us/dotnet/api/system.servicemodel.channels.messageproperties.item?view=dotnet-plat-ext-6.0&viewFallbackFrom=net-6.0#system-servicemodel-channels-messageproperties-item(system-string)
Documentation source:
https://github.com/dotnet/dotnet-api-docs/blob/main/xml/System.ServiceModel.Channels/MessageProperties.xml
dotnet/wcf source code:
https://github.com/dotnet/wcf/blob/4e2a97e639417fd14158c9e7f0bb36de342a667d/src/System.Private.ServiceModel/src/System/ServiceModel/Channels/MessageProperties.cs#L73
4.8 reference source has the same behaviour:
https://referencesource.microsoft.com/#System.ServiceModel/System/ServiceModel/Channels/MessageProperties.cs,67
Beitragsleitfaden
Rechercherichtung
Öffne xml/System.ServiceModel.Channels/MessageProperties.xml und suche die Dokumentation für MessageProperties.Item[string]. Vergleiche das dort beschriebene Verhalten mit der verknüpften Implementierung in MessageProperties.cs. Aktualisiere die Dokumentation, um das Verhalten zu beschreiben, wenn die Eigenschaft nicht vorhanden ist, und überprüfe anschließend, dass der gerenderte Text zum Rückgabewert mit der Implementierung übereinstimmt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- csharp
- Bereich
- documentation
- Issue-Typ
- Dokumentation
- Schwierigkeit
- 1/5
- Geschätzter Aufwand
- Unter einer Stunde
- Aktivitätsstatus
- Veraltet
- Klarheit
- Klar beschrieben
- Anfängerfreundlichkeit
- 42/100