forked from dotnet/aspnetcore
-
Notifications
You must be signed in to change notification settings - Fork 10
[CORRUPTED] Synthetic Benchmark PR #64636 - Blazor supports DisplayName for models
#84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
tomerqodo
wants to merge
17
commits into
base_pr_64636_20260121_5690
Choose a base branch
from
corrupted_pr_64636_20260121_5690
base: base_pr_64636_20260121_5690
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
[CORRUPTED] Synthetic Benchmark PR #64636 - Blazor supports DisplayName for models
#84
tomerqodo
wants to merge
17
commits into
base_pr_64636_20260121_5690
from
corrupted_pr_64636_20260121_5690
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Javier Calvarro Nelson <[email protected]>
This was referenced Jan 21, 2026
This was referenced Jan 26, 2026
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Benchmark PR dotnet#64636
Type: Corrupted (contains bugs)
Original PR Title: Blazor supports
DisplayNamefor modelsOriginal PR Description: # Summary
This PR adds the
DisplayName<TValue>component to enable displaying property display names from[Display]and[DisplayName]attributes in Blazor applications, addressing the feature gap identified in issue dotnet#49147.Background
Blazor currently lacks a built-in mechanism to display property names from metadata attributes like MVC's
@Html.DisplayNameFor()helper. This forces developers to either:The new
DisplayName<TValue>component provides an attribute-based solution that follows the same familiar pattern as other Blazor form components likeValidationMessage<TValue>.Fixes dotnet#49147
Changes
Public API
Implementation Details
The component extracts the property name from the expression and reads display metadata:
DisplayAttribute.Name(System.ComponentModel.DataAnnotations)DisplayNameAttribute.DisplayName(System.ComponentModel)Tests
Unit tests in
src/Components/Web/test/Forms/DisplayNameTest.cs:Forparameter is missingDisplayAttribute.NamecorrectlyDisplayNameAttribute.DisplayNamecorrectlyDisplayAttributetakes precedence overDisplayNameAttributeE2E test in
src/Components/test/E2ETest/Tests/FormsTest.cs:DisplayNamelReadsAttributesCorrectly()- Verifies the component renders correctly in a browser with all attribute scenariosAPI usage
Basic form usage:
renders e.g. as:
Table headers:
renders e.g. as:
Model example:
Original PR URL: dotnet#64636