private Guid CreateScenario() { var company = new Company() {Name = "Company test"}; var address = new Address() {Name = "Address test"}; var bankAccount = new BankAccount() {Name = "Bank test"}; company.AddAddress(address); company.AddBank(bankAccount); using (ISession session = sessions.OpenSession()) { using (ITransaction tx = session.BeginTransaction()) { session.Persist(company); tx.Commit(); } } return company.Id; }
public virtual void RemoveCompany() { this.Company = null; }
public virtual bool AddCompany(Company company) { if (company == null) { return false; } this.Company = company; if (company.AddAddress(this)) return true; return false; }