public override int GetHashCode() { unchecked // Overflow is fine, just wrap { int hash = (int)2166136261; hash = (hash * 16777619) ^ CarModel?.GetHashCode() ?? 0; hash = (hash * 16777619) ^ EngineType?.GetHashCode() ?? 0; hash = (hash * 16777619) ^ Year.GetHashCode(); return(hash); } }