dotnet / dotnet/dotnet-api-docs
MessageProperties.Item[string] can throw, but documentation claims null is returned
- Lenguaje dominante
- C#
- Estrellas
- 949
- Forks
- 1.7k
- Merge medio
- 2 d 19 h
- PR fusionados (30 d)
- 52
Descripción
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
Guía de contribución
Línea de trabajo
Abre xml/System.ServiceModel.Channels/MessageProperties.xml y localiza la documentación de MessageProperties.Item[string]. Compara el comportamiento indicado con la implementación vinculada de MessageProperties.cs. Actualiza la documentación para describir el comportamiento cuando la propiedad no existe y, después, verifica que el texto renderizado del valor devuelto coincida con la implementación.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- csharp
- Área
- documentation
- Tipo de issue
- Documentación
- Dificultad
- 1/5
- Tiempo estimado
- Menos de una hora
- Estado de actividad
- Estancado
- Claridad
- Bien especificado
- Aptitud para principiantes
- 42/100