public virtual void createData() { using (ISession session = sessions.OpenSession()) { using (ITransaction tx = session.BeginTransaction()) { var usa = new Country(); session.Save(usa); list.Add(usa); var disney = new Org(); disney.Country = usa; session.Save(disney); list.Add(disney); var waltDisney = new Contact(); waltDisney.Org = disney; session.Save(waltDisney); list.Add(waltDisney); tx.Commit(); } } }