Snippet: IEqualityComparer<T> class

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

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 : 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();
	}
}