dotnet / dotnet/dotnet-api-docs

DisplayAttribute string properties: Remarks incorrectly state the property performs resource lookup

Open Beginner friendly
#13,023 1 comment 0 reactions 0 assignees View on GitHub
area-System.ComponentModel.DataAnnotations untriaged
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:

Image

DisplayAttribute.Name docs do highlight that it may be a resource key string and suggest to use GetName() for UI:

Image

### 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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.