public int CompareTo(ContentMetaKey other) { if (ReferenceEquals(this, other)) { return(0); } if (ReferenceEquals(null, other)) { return(1); } int titleIdComparison = TitleId.CompareTo(other.TitleId); if (titleIdComparison != 0) { return(titleIdComparison); } int versionComparison = Version.CompareTo(other.Version); if (versionComparison != 0) { return(versionComparison); } int typeComparison = Type.CompareTo(other.Type); if (typeComparison != 0) { return(typeComparison); } return(Flags.CompareTo(other.Flags)); }
public int CompareTo(ContentMetaKey other) { if (ReferenceEquals(this, other)) return 0; if (ReferenceEquals(null, other)) return 1; int titleIdComparison = TitleId.CompareTo(other.TitleId); if (titleIdComparison != 0) return titleIdComparison; int versionComparison = Version.CompareTo(other.Version); if (versionComparison != 0) return versionComparison; int typeComparison = Type.CompareTo(other.Type); if (typeComparison != 0) return typeComparison; return Flags.CompareTo(other.Flags); }
public override int GetHashCode() { unchecked { // ReSharper disable NonReadonlyMemberInGetHashCode int hashCode = TitleId.GetHashCode(); hashCode = (hashCode * 397) ^ (int)Version; hashCode = (hashCode * 397) ^ Type.GetHashCode(); hashCode = (hashCode * 397) ^ Flags.GetHashCode(); return(hashCode); // ReSharper restore NonReadonlyMemberInGetHashCode } }