-
Couldn't load subscription status.
- Fork 454
[Property Column] Remove boxing when formatting the property. #4070
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
[Property Column] Remove boxing when formatting the property. #4070
Conversation
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.
Pull Request Overview
This PR removes the boxing overhead when formatting property values in the PropertyColumn component by implementing type-specific formatters through reflection. It addresses the TODO comment about avoiding boxing value types when calling IFormattable.ToString().
- Replaces generic boxing approach with specialized formatters for nullable value types, value types, and reference types
- Adds comprehensive test coverage for all formatter scenarios including error cases
- Removes unnecessary else clause in the non-formatting path
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| PropertyColumn.cs | Implements type-specific formatters using reflection to avoid boxing, adds CreateFormatter method and specialized formatting helpers |
| PropertyColumnFormatterTests.razor.cs | Adds test infrastructure with Person record and CustomFormattable class for testing different formatting scenarios |
| PropertyColumnFormatterTests.razor | Provides test cases covering value types, nullable types, reference types, and error conditions |
Comments suppressed due to low confidence (2)
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
|
Need to take a proper look at it from a PC. Won't be near one for the next week and a half... |
* Implement #4036 * Implement #4070 * Implement #4112 * Implement #4116 * Add extra test. Brings back code coverage to 100% for Row and Cell * Implement #4172 * Implement #4177 * - Remove NoTabbing parameter (not being used) - Exclude ErrorContent from code coverage - Add (partial) ErrorContentTest, add IsFixed test, update tests * Implement #4178 Related Work Items: #41 * Add CustomIcon and IconsExtensions + tests --------- Co-authored-by: Denis Voituron <[email protected]>
Pull Request
📖 Description
This pr will remove the TODO from the property column about boxing value types when using a format.
📑 Test Plan
Added test cases for each type of format (nullable value types, value types and reference types).
Also added test to check if exception is thrown.
✅ Checklist
General
Component-specific