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
Type of issue
Other (describe below)
Description
The Remarks section on
ShortNamecurrently states that the property returns thelocalized string when
ResourceTypeis specified and the value represents a resource key.That describes
GetShortName(), not the property. The property getter returns the #rawvalue — 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