Пример #1
0
        protected override void OnSetUp()
        {
            using (ISession session = OpenSession())
                using (ITransaction tx = session.BeginTransaction())
                {
                    var entity1 = new Entity1();
                    var entity2 = new Entity2();
                    var entity3 = new Entity3();

                    entity1.Entity2 = entity2;
                    entity2.Entity3s.Add(entity3);
                    entity3.Entity2 = entity2;

                    session.Save(entity1);
                    session.Save(entity2);
                    session.Save(entity3);

                    _entity3Id = entity3.Id;

                    tx.Commit();
                }
        }
Пример #2
0
		protected override void OnSetUp()
		{
			using (ISession session = OpenSession())
			using (ITransaction tx = session.BeginTransaction())
			{
				var entity1 = new Entity1();
				var entity2 = new Entity2();
				var entity3 = new Entity3();

				entity1.Entity2 = entity2;
				entity2.Entity3s.Add(entity3);
				entity3.Entity2 = entity2;

				session.Save(entity1);
				session.Save(entity2);
				session.Save(entity3);

				_entity3Id = entity3.Id;

				tx.Commit();
			}
		}