dotnet / dotnet/dotnet-api-docs
DisplayAttribute string properties: Remarks incorrectly state the property performs resource lookup
- Dominant language
- C#
- Stars
- 949
- Forks
- 1.7k
- Avg merge
- 3d 27m
- Merged PRs (30d)
- 49
Description
### Type of issue
Other (describe below)
### Description
The Remarks section on `ShortName` currently states that *the property* returns the
localized string when `ResourceType` is specified and the value represents a resource key.
That describes `GetShortName()`, not the property. The property getter returns the #raw
value — either a literal string or a resource key — and performs no lookup.
The summary of DisplayAttribute.ShortName that says that ShortName may be a resource key string:
DisplayAttribute.Name docs do highlight that it may be a resource key string and suggest to use GetName() for UI:
### Page URL
https://learn.microsoft.com/en-us/dotnet/api/system.componentmodel.dataannotations.displayattribute.shortname?view=net-5.0#system-componentmodel-dataannotations-displayattribute-shortname
### Content source URL
https://github.com/dotnet/dotnet-api-docs-temp/blob/live/xml/System.ComponentModel.DataAnnotations/DisplayAttribute.xml
### Document Version Independent Id
e1258848-d7f7-52b7-7fcd-10af6741e913
### Platform Id
c48099ec-c828-67a4-0987-e5bb23e93914
### Article author
@dotnet-bot
Contributor guide
Research direction
Open the DisplayAttribute.xml source and locate the documentation for the ShortName property. Compare its Remarks with the Name documentation and the distinction between the property and GetShortName(). Done means the ShortName docs accurately describe the raw value and do not say that the property performs resource lookup.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 1/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 88/100