To create stub overrides for
Equals() and GetHashCode() methods
- In the editor, position the caret within a class.
- On the main menu, choose ReSharper | Edit | Generate Code, or press Alt+Insert.
- From the Generate pop-up menu, select Equality members.
- On the Generate equality members page of the Generate wizard, select fields to be compared with the
Equals()method.
Optionally, use the following controls:- Fields can be null includes nullity check for every participating type member into the expression that the overridden
GetHashCode()method returns (to configure nullity check for specific members, click Advanced). - GetHashCode already exists and Equals already exists let you indicate whether to:
- Replace the corresponding override if it already exists.
- Put the newly generated override side by side with the existing override.
- Skip generating a new override altogether.
- Equality operators generates custom equality and inequality operators in the current type.
- Implement IEquatable<T> interface implements a type-specific
Equals()method. - Copy XML documentation copies documentation from all overridden members to all overriding members (to specify whether documentation should be copied for every individual member, click Advanced).
- Fields can be null includes nullity check for every participating type member into the expression that the overridden
- Do one of the following:
- To configure nullity and XML documentation options individually for specific members, click Advanced. After finishing this step, click Next.
- Click Finish to complete the wizard.
