public ListScenario(ISessionFactory factory) { this.factory = factory; using (ISession s = factory.OpenSession()) using (ITransaction t = s.BeginTransaction()) { var entity = new Parent(); var child = new Child(); entity.ListChildren = new List<Child> {null, child, null}; s.Save(entity); t.Commit(); } }
public MapScenario(ISessionFactory factory) { this.factory = factory; using (ISession s = factory.OpenSession()) using (ITransaction t = s.BeginTransaction()) { var entity = new Parent(); entity.MapChildren = new Dictionary<int, Child> { {0, null}, {1, new Child()}, {2, null}, }; s.Save(entity); t.Commit(); } }