コード例 #1
0
        public override int GetHashCode()
        {
            unchecked
            {
                const int HashingBase       = (int)2166136261;
                const int HashingMultiplier = 16777619;

                int hash = HashingBase;
                hash = (hash * HashingMultiplier) ^ (BudynekId.GetHashCode());
                hash = (hash * HashingMultiplier) ^ (Object.ReferenceEquals(null, Nazwa) ? 0: Nazwa.GetHashCode());

                int a = 12;
                return(hash);
            }
        }
コード例 #2
0
        //public override  bool Equals(Object _other)
        //{
        //    IDzialka_Budynek other = _other as IDzialka_Budynek;

        //    return DzialkaId.Equals(other.DzialkaId) &&
        //           BudynekId.Equals(other.BudynekId);
        //}

        //public override int GetHashCode() => (DzialkaId, BudynekId).GetHashCode();

        public override int GetHashCode()
        {
            unchecked
            {
                const int HashingBase       = (int)2166136261;
                const int HashingMultiplier = 16777619;

                int hash = HashingBase;
                hash = (hash * HashingMultiplier) ^ (!Object.ReferenceEquals(null, DzialkaId) ? DzialkaId.GetHashCode() : 0);
                hash = (hash * HashingMultiplier) ^ (!Object.ReferenceEquals(null, BudynekId) ? BudynekId.GetHashCode() : 0);
                return(hash);
            }
        }