Snippet: IEqualityComparer<T> class

property value
IDE VS Code
Language C#
Title IEqualityComparer<T> class
Shortcut c_IEqualityComparerOfT
Description class that implements IEqualityComparer<T>

Placeholders

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

Code

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

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

		
		throw new NotImplementedException();
	}

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

		throw new NotImplementedException();
	}
}