Skip to content

Conversation

@ilonatommy
Copy link
Member

@ilonatommy ilonatommy commented Dec 4, 2025

@ilonatommy ilonatommy added the 11.0 .NET 11 label Dec 4, 2025
@guardrex guardrex self-assigned this Dec 4, 2025
Copy link
Collaborator

@guardrex guardrex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ilonatommy ... Approving with tiny NITs.

I'll take care of the release notes. I'll ping you on that PR when it goes up within the next few days.

public DateTime ProductionDate { get; set; }
```

[`[DisplayName]` attribute](xref:System.ComponentModel.DisplayNameAttribute) is also supported:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
[`[DisplayName]` attribute](xref:System.ComponentModel.DisplayNameAttribute) is also supported:
The [`[DisplayName]` attribute](xref:System.ComponentModel.DisplayNameAttribute) is also supported:

public DateTime ProductionDate { get; set; }
```

Between the two approaches, the `[Display]` attribute is recommended, which makes additional properties available. The `[Display]` attribute also enables assigning a resource type for localization. When both attributes are present, `[Display]` takes precedence over `[DisplayName]`. If neither attribute is present, the component falls back to the property name itself.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Between the two approaches, the `[Display]` attribute is recommended, which makes additional properties available. The `[Display]` attribute also enables assigning a resource type for localization. When both attributes are present, `[Display]` takes precedence over `[DisplayName]`. If neither attribute is present, the component falls back to the property name itself.
Between the two approaches, the `[Display]` attribute is recommended, which makes additional properties available. The `[Display]` attribute also enables assigning a resource type for localization. When both attributes are present, `[Display]` takes precedence over `[DisplayName]`. If neither attribute is present, the component falls back to the property name.

:::moniker range=">= aspnetcore-11.0"

-->
The <xref:Microsoft.AspNetCore.Components.Forms.DisplayName%601> component can be used to display property names from metadata attributes. The [`[Display]` attribute](xref:System.ComponentModel.DataAnnotations.DisplayAttribute) on the model class property is supported:
Copy link
Collaborator

@guardrex guardrex Dec 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One other little problem here: The first line refers to the DisplayName component, but the second refers to the [Display] attribute. The component isn't covered until the end of the added content. Should that line be moved down here?

... OR ...

Since the component is mentioned in the paragraph on Line 479, should the component example at the bottom be moved to the top of this added content?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

11.0 .NET 11

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants