-
Notifications
You must be signed in to change notification settings - Fork 6k
Update value equality article with records examples, detailed justifications, and improved formatting #48010
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
Conversation
…fications Co-authored-by: BillWagner <493969+BillWagner@users.noreply.github.com>
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.
Overall, this is good. I've got a couple suggestions for you.
...ppets/how-to-define-value-equality-for-a-type/ValueEqualityRecord/ValueEqualityRecord.csproj
Show resolved
Hide resolved
...ns-operators/snippets/how-to-define-value-equality-for-a-type/ValueEqualityRecord/Program.cs
Outdated
Show resolved
Hide resolved
...ns-operators/snippets/how-to-define-value-equality-for-a-type/ValueEqualityRecord/Program.cs
Outdated
Show resolved
Hide resolved
...rogramming-guide/statements-expressions-operators/how-to-define-value-equality-for-a-type.md
Outdated
Show resolved
Hide resolved
@copilot Address the unresolved comments. |
Co-authored-by: BillWagner <493969+BillWagner@users.noreply.github.com>
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.
This is now ready for final review.
...rogramming-guide/statements-expressions-operators/how-to-define-value-equality-for-a-type.md
Outdated
Show resolved
Hide resolved
...rogramming-guide/statements-expressions-operators/how-to-define-value-equality-for-a-type.md
Outdated
Show resolved
Hide resolved
Co-authored-by: Genevieve Warren <24882762+gewarren@users.noreply.github.com>
Co-authored-by: BillWagner <493969+BillWagner@users.noreply.github.com>
All new comments have been addressed. The records recommendation is now highlighted in a TIP block format as requested. |
Enhanced the "How to define value equality for a class or struct" article to better address modern C# practices and provide clear guidance on implementation approaches.
Key Changes
1. Prominently Position Records as the Preferred Approach
Added a prominent TIP block at the beginning to clearly recommend records first, with conditional guidance for when manual implementation is needed:
Tip
Consider using records first. Records automatically implement value equality with minimal code, making them the recommended approach for most data-focused types.
2. Added Comprehensive Record Example
Created a new "Record example" section with a complete working demonstration showing:
3. Added Detailed Justifications for Manual Implementation Steps
Each of the 5 implementation steps now includes clear explanations of WHY they're needed:
4. Improved Documentation Quality
The article now provides a modern, comprehensive guide that prioritizes the recommended approach while still providing complete guidance for manual implementation scenarios.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.
Internal previews