Пример #1
0
 /// <inheritdoc />
 public override int GetHashCode()
 {
     unchecked
     {
         // ReSharper disable NonReadonlyMemberInGetHashCode
         var hashCode = Id;
         hashCode = (hashCode * 397) ^ IsBot.GetHashCode();
         hashCode = (hashCode * 397) ^ (FirstName?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (LastName?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (Username?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (LanguageCode?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (CanJoinGroups?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (CanReadAllGroupMessages?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (SupportsInlineQueries?.GetHashCode() ?? 0);
         // ReSharper restore NonReadonlyMemberInGetHashCode
         return(hashCode);
     }
 }
Пример #2
0
        public override int GetHashCode()
        {
            int hashCode = 1040595173;

            hashCode = hashCode * -1521134295 + Id.GetHashCode();
            hashCode = hashCode * -1521134295 + IsBot.GetHashCode();
            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(FirstName);

            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(LastName);

            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Username);

            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(LanguageCode);

            hashCode = hashCode * -1521134295 + CanJoinGroups.GetHashCode();
            hashCode = hashCode * -1521134295 + CanReadAllGroupMessages.GetHashCode();
            hashCode = hashCode * -1521134295 + SupportsInlineQueries.GetHashCode();
            return(hashCode);
        }