-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[dotnet] Standardize IEquatable<T> implementations across types overriding Equals
#16665
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: trunk
Are you sure you want to change the base?
Conversation
|
Thank you, @RenderMichael for this code suggestion. The support packages contain example code that many users find helpful, but they do not necessarily represent After reviewing the change, unless it is a critical fix or a feature that is needed for Selenium We actively encourage people to add the wrapper and helper code that makes sense for them to their own frameworks. |
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
|||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||||
| namespace OpenQA.Selenium.BiDi.BrowsingContext; | ||
|
|
||
| public sealed class BrowsingContext | ||
| public sealed class BrowsingContext : IEquatable<BrowsingContext> |
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.
In BiDi namespace this type wants to be a record. Historically I used class just as quick start. record's equality treats all properties. If we can resolve it somehow, it would be amazing.
User description
It is considered standard practice to implement
IEquatable<T>when overridingbool Equals(object).🔄 Types of changes
PR Type
Enhancement
Description
Implement
IEquatable<T>interface across multiple typesStandardize
Equals()method implementations with proper null handlingImprove hash code calculations for better equality semantics
Update XML documentation to use standard
<see langword>tagsDiagram Walkthrough
File Walkthrough
10 files
Add IEquatable implementations to event firing elementsImplement IEquatable with ordinal comparisonAdd IEquatable with ordinal string comparisonImplement IEquatable with ordinal comparisonImplement IEquatable with improved hash codeAdd IEquatable implementationImplement IEquatable with refactored logicImprove hash code calculation with null-coalescing operatorAdd IEquatable implementationImplement IEquatable with proper delegation2 files
Update documentation tags to use langword formatUpdate documentation tags to use langword format