Exemplo n.º 1
0
        public override int GetHashCode()
        {
            var hashCode = -783462530;

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

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

            return(hashCode);
        }
        /// <summary>
        /// Gets the hash code
        /// </summary>
        /// <returns>Hash code</returns>
        public override int GetHashCode()
        {
            // credit: http://stackoverflow.com/a/263416/677735
            unchecked // Overflow is fine, just wrap
            {
                int hash = 41;

                // Suitable nullity checks
                hash = hash * 59 + RoleId.GetHashCode();
                hash = hash * 59 + PermissionId.GetHashCode();

                if (Id != null)
                {
                    hash = hash * 59 + Id.GetHashCode();
                }

                return(hash);
            }
        }