-
Notifications
You must be signed in to change notification settings - Fork 0
Blazor supports DisplayName for models
#14
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
base: cursor_combined_20260121_qodo_grep_cursor_copilot_1_base_blazor_supports_displayname_for_models_pr84
Are you sure you want to change the base?
Conversation
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Javier Calvarro Nelson <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
|
|
||
| internal static class ExpressionMemberAccessor | ||
| { | ||
| private static readonly ConcurrentDictionary<Expression, MemberInfo> _memberInfoCache = new(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Memory leak from caching expressions by reference equality
High Severity
The _memberInfoCache uses Expression objects as dictionary keys, but Expression doesn't override Equals/GetHashCode, so reference equality is used. Since Blazor creates new expression objects each render (e.g., () => model.Property), every render adds a new cache entry. This causes unbounded memory growth and prevents garbage collection of captured model objects referenced by the expressions.
Benchmark PR from qodo-benchmark#84
Note
Adds a reusable way to render model field labels based on annotations and adopts it in templates.
DisplayName<TValue>component resolves display text viaDisplayAttribute/DisplayNameAttribute, falling back to the property nameExpressionMemberAccessorparses field expressions, caches member info, and clears cache on hot reloadDisplayName<TValue>DisplayNameComponent.razorand new resource strings (Resources.resx/Resources.fr.resx) for localizationForgotPassword,Login,Register,Manage/ChangePassword,Manage/Email,ResetPassword) now useDisplayNamein labels; correspondingInputModelproperties annotated withDisplayWritten by Cursor Bugbot for commit 028e82f. Configure here.