using System.Collections.Generic;
public static void Main()
var list = new List<Tester>();
var testerA = new Tester("PHYSICIAN_T");
var testerB = new Tester("PHYSICIAN_T");
Console.WriteLine(string.Format("Are equal? {0}", testerA.Equals(testerB)));
Console.WriteLine(string.Format("List count? {0}", list.Distinct().Count()));
public class Tester : IEquatable<Tester> {
public string EntityType {get;set;}
public Tester(string entityType) {
this.EntityType = entityType;
public bool Equals(Tester other)
if (Object.ReferenceEquals(other, null)) return false;
if (Object.ReferenceEquals(this, other)) return true;
return EntityType.Equals(other.EntityType);
public override int GetHashCode()
return EntityType.GetHashCode();