Snippet: IEqualityComparer class

property value
IDE Visual Studio
Language C#
Title IEqualityComparer class
Shortcut c_
Description class that implements IEqualityComparer
Snippet Types Expansion
Namespaces System
System.Collections

Placeholders

Identifier Tooltip Default Value Editable Function Type Name
modifier Modifier(s) public yes
name Equality comparer type name EqualityComparer yes
type Type name object yes

Code

public class EqualityComparer : IEqualityComparer {
	new public bool Equals(object x, object y) {
		if (object.ReferenceEquals(x, y)) {
			return true;
		}

		if (x == null || y == null) {
			return false;
		}

		var a = (object)x;
		var b = (object)y;

		
		throw new NotImplementedException();
	}

	public int GetHashCode(object obj) {
		if (obj == null) {
			return 0;
		}

		throw new NotImplementedException();
	}
}