Esempio n. 1
0
		protected override void OnSetUp()
		{
			using (var session = OpenSession())
			using (var tx = session.BeginTransaction())
			{
				var parent1 = new Parent();
				var child1 = new ChildComponent { Parent = parent1, SomeBool = true, SomeString = "something" };
				parent1.ChildComponents.Add(child1);

				var parent2 = new Parent();

				session.Save(parent1);
				session.Save(parent2);

				tx.Commit();
			}
		}
Esempio n. 2
0
        protected override void OnSetUp()
        {
            using (var session = OpenSession())
                using (var tx = session.BeginTransaction())
                {
                    var parent1 = new Parent();
                    var child1  = new ChildComponent {
                        Parent = parent1, SomeBool = true, SomeString = "something"
                    };
                    parent1.ChildComponents.Add(child1);

                    var parent2 = new Parent();

                    session.Save(parent1);
                    session.Save(parent2);

                    tx.Commit();
                }
        }