protected override void Initialize() { var child1 = new BagChild { Name = "child1" }; var parent = new BagParent(); parent.AddChild(child1); //Revision 1 using (var tx = Session.BeginTransaction()) { parentId = (Guid)Session.Save(parent); tx.Commit(); } //Revision 2 using (var tx = Session.BeginTransaction()) { child1.Name = "child12"; tx.Commit(); } //Revision 3 using (var tx = Session.BeginTransaction()) { Session.Delete(parent); tx.Commit(); } }
protected override IParent CreateParent(int numberOfChildren) { var parent = new BagParent(); for (var i = 0; i < numberOfChildren; i++) { parent.Children.Add(new Child { Name = "child" + i }); } return(parent); }