public override int GetHashCode() { // http://stackoverflow.com/questions/263400/what-is-the-best-algorithm-for-an-overridden-system-object-gethashcode/263416#263416 unchecked // Overflow is fine, just wrap { int hash = 17; // Suitable nullity checks etc, of course :) hash = hash * 486187739 + GroupKey.ToLowerInvariant().GetHashCode(); hash = hash * 486187739 + CommandKey.ToLowerInvariant().GetHashCode(); return(hash); } }