예제 #1
0
		protected override void OnSetUp()
		{
			base.OnSetUp();

			using (var s = OpenSession())
			using (var tx = s.BeginTransaction())
			{
				var emp = new Employee() {EmployeeId = 1, NationalId = 1000};
				emp.Addresses.Add(new EmployeeAddress() { Employee = emp, Type = "Postal" });
				emp.Addresses.Add(new EmployeeAddress() { Employee = emp, Type = "Shipping" });
				s.Save(emp);
				tx.Commit();
			}
		}
예제 #2
0
		public virtual bool Equals(Employee other)
		{
			if (ReferenceEquals(null, other)) return false;
			if (ReferenceEquals(this, other)) return true;
			return other.NationalId == NationalId && other.EmployeeId == EmployeeId;
		}