public override bool Equals(object o) { if (!(o is Player)) { return(false); } var p = (Player)o; return(ExpectedSeason.Equals(p.ExpectedSeason) && FullName.Equals(p.FullName) && Id == p.Id && GetHashCode() == p.GetHashCode()); }
public override int GetHashCode() { unchecked { // Choose large primes to avoid hashing collisions const int hashingBase = (int)2166136261; const int hashingMultiplier = 16777619; var hash = hashingBase; hash = (hash * hashingMultiplier) ^ (!(ExpectedSeason is null) ? ExpectedSeason.GetHashCode() : 0); hash = (hash * hashingMultiplier) ^ (!(FullName is null) ? FullName.GetHashCode() : 0); hash = (hash * hashingMultiplier) ^ (!(Id is null) ? Id.GetHashCode() : 0); return(hash); } }