コード例 #1
0
		public virtual bool Equals(ClassOverridingEqualsAndGetHashCode other)
		{
			if (other == null)
				return false;

			// use this pattern to compare value members
			if (!Id.Equals(other.Id))
				return false;

			// use this pattern to compare reference members
			// if (!Object.Equals(Id, other.Id)) return false;

			return true;
		}
        public virtual bool Equals(ClassOverridingEqualsAndGetHashCode other)
        {
            if (other == null)
            {
                return(false);
            }

            // use this pattern to compare value members
            if (!Id.Equals(other.Id))
            {
                return(false);
            }

            // use this pattern to compare reference members
            // if (!Object.Equals(Id, other.Id)) return false;

            return(true);
        }