コード例 #1
0
ファイル: Employee.cs プロジェクト: damonallison/dotnet
        /// <summary>
        /// GetHashCode() should not change over the life of the object. This only works
        /// when values used within the hashCode are immutable. This object does *not*
        /// keep a consistent HashCode over the lifetime of the object since the variables
        /// upon which it's based (Name) is mutable.
        /// </summary>
        public override int GetHashCode()
        {
            int hashCode = base.GetHashCode();
            int prime    = 31;

            hashCode = hashCode * prime + LanId == null ? 0 : LanId.GetHashCode();
            return(hashCode);
        }