[CORRUPTED] Synthetic Benchmark PR #64636 - Blazor supports DisplayName for models#84
Open
tomerqodo wants to merge 17 commits intobase_pr_64636_20260121_5690from
Open
[CORRUPTED] Synthetic Benchmark PR #64636 - Blazor supports DisplayName for models#84tomerqodo wants to merge 17 commits intobase_pr_64636_20260121_5690from
DisplayName for models#84tomerqodo wants to merge 17 commits intobase_pr_64636_20260121_5690from
Conversation
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Javier Calvarro Nelson <jacalvar@microsoft.com>
This was referenced Jan 21, 2026
This was referenced Jan 26, 2026
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
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