Esempio n. 1
0
        protected override void OnSetUp()
        {
            using (ISession session = OpenSession())
                using (ITransaction transaction = session.BeginTransaction())
                {
                    var e1 = new Entity {
                        Name = "Bob"
                    };
                    session.Save(e1);


                    var e2 = new Entity {
                        Name = "Sally"
                    };
                    var ed2 = new EntityDetail(e2)
                    {
                        ExtraInfo = "Jo"
                    };
                    e2.Detail = ed2;

                    session.Save(e2);

                    session.Flush();
                    transaction.Commit();
                }
        }
Esempio n. 2
0
		protected override void OnSetUp()
		{
			using (ISession session = OpenSession())
			using (ITransaction transaction = session.BeginTransaction())
			{
				var e1 = new Entity { Name = "Bob" };
				session.Save(e1);


				var e2 = new Entity { Name = "Sally" };
				var ed2 = new EntityDetail(e2) { ExtraInfo = "Jo" };
				e2.Detail = ed2;

				session.Save(e2);

				session.Flush();
				transaction.Commit();
			}
		}