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(); } }
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; }