Snippet: Equals and GetHashCode for value type

property value
IDE Visual Studio
Language C#
Title Equals and GetHashCode for value type
Shortcut equals
Description overriding Equals and GetHashCode methods for value type
Snippet Types Expansion
Namespaces System


Identifier Tooltip Default Value Editable Function Type Name
thisName Containing type name ThisName no ClassName()


public override bool Equals(object obj) {
	if(!(obj is ThisName)) {
		return false;

	var other = (ThisName)obj;

	throw new NotImplementedException();

public override int GetHashCode() {
	throw new NotImplementedException();