-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Closed
Labels
area-minimalIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcfeature-validationIssues related to model validation in minimal and controller-based APIsIssues related to model validation in minimal and controller-based APIs
Milestone
Description
For members with DisplayAttribute
, this logic extracts the first named argument and uses it as the display name:
Lines 19 to 26 in 215bfd3
if (displayNameAttribute.ConstructorArguments.Length > 0) | |
{ | |
return displayNameAttribute.ConstructorArguments[0].Value?.ToString() ?? property.Name; | |
} | |
else if (displayNameAttribute.NamedArguments.Length > 0) | |
{ | |
return displayNameAttribute.NamedArguments[0].Value.Value?.ToString() ?? property.Name; | |
} |
This chooses a bad display name when the attribute is used like this, for example:
[Display(
ResourceType = typeof(OptionsDisplayStrings),
Description = nameof(OptionsDisplayStrings.DisplayAttributeDescription_CollectionRuleActionOptions_Name))]
The display name ends up as "Microsoft.Diagnostics.Monitoring.WebApi.OptionsDisplayString".
Metadata
Metadata
Assignees
Labels
area-minimalIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcfeature-validationIssues related to model validation in minimal and controller-based APIsIssues related to model validation in minimal and controller-based APIs