productpk.cs

来自「NHibernate NET开发者所需的」· CS 代码 · 共 38 行

CS
38
字号
using System;

namespace NHibernate.Test.NHSpecificTest.NH296
{
	public class ProductPK
	{
		private int _type;
		private int _number;

		public int Type
		{
			get { return _type; }
			set { _type = value; }
		}

		public int Number
		{
			get { return _number; }
			set { _number = value; }
		}

		public override bool Equals(object obj)
		{
			if (!(obj is ProductPK))
			{
				return false;
			}

			ProductPK other = (ProductPK) obj;
			return other._type == _type && other._number == _number;
		}

		public override int GetHashCode()
		{
			return _type.GetHashCode();
		}
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?