Пример #1
0
        public override string ToString()
        {
            var str = "Pos: {0} - Name: {1}, IsNew: {2}, IsTransient: {3}".FormatCurrent(
                Position,
                EntityDisplayName.EmptyNull(),
                _initialized ? IsNew.ToString() : "-",
                _initialized ? IsTransient.ToString() : "-");

            return(str);
        }
        public override int GetHashCode()
        {
            var hash = 17;

            hash = hash * 23 + (Name != null ? Name.GetHashCode() : 0);
            hash = hash * 23 + (FieldType != null ? FieldType.GetHashCode() : 0);
            hash = hash * 23 + IsTransient.GetHashCode();
            hash = hash * 23 + (DeclaringType != null ? DeclaringType.GetHashCode() : 0);

            return(hash);
        }
Пример #3
0
        public override int GetHashCode()
        {
            var hash = 17;

            hash = hash * 23 + (Name != null ? Name.GetHashCode() : 0);
            hash = hash * 23 + (TypeAQN != null ? TypeAQN.GetHashCode() : 0);
            hash = hash * 23 + IsTransient.GetHashCode();
            hash = hash * 23 + (OwningTypeAQN != null ? OwningTypeAQN.GetHashCode() : 0);

            return(hash);
        }
Пример #4
0
        /// <summary>
        ///   Gets the hash code for the persistable object.
        /// </summary>
        /// <returns>The hash code.</returns>
        public override int GetHashCode()
        {
            // Cast ourselves as a keyed object...
            var keyedObject = this as IKeyed;

            // If we are keyed then return the key hash...
            if (keyedObject != null && string.IsNullOrEmpty(keyedObject.Key) == false)
            {
                return(keyedObject.Key.GetHashCode());
            }

            // If we're not transient then return the hash of our surrogate id...
            if (IsTransient.IsFalse())
            {
                return(Sid.GetHashCode());
            }

            return(base.GetHashCode());
        }