Beispiel #1
0
		public void Bug()
		{
			using (ISession session = OpenSession())
			{
				ITransaction transaction = session.BeginTransaction();

				Blog blog = new Blog();
				blog.Name = "Test Blog 1";

				Entry entry = new Entry();
				entry.Subject = "Test Entry 1";

				blog.AddEntry(entry);

				session.SaveOrUpdate(blog);

				transaction.Commit();
			}
			using (ISession session = OpenSession())
			{
				ITransaction transaction = session.BeginTransaction();
				session.Delete("from Blog");
				transaction.Commit();
			}
		}
Beispiel #2
0
        public void Bug()
        {
            using (ISession session = OpenSession())
            {
                ITransaction transaction = session.BeginTransaction();

                Blog blog = new Blog();
                blog.Name = "Test Blog 1";

                Entry entry = new Entry();
                entry.Subject = "Test Entry 1";

                blog.AddEntry(entry);

                session.SaveOrUpdate(blog);

                transaction.Commit();
            }
            using (ISession session = OpenSession())
            {
                ITransaction transaction = session.BeginTransaction();
                session.Delete("from Blog");
                transaction.Commit();
            }
        }
Beispiel #3
0
        public async Task BugAsync()
        {
            using (ISession session = OpenSession())
            {
                ITransaction transaction = session.BeginTransaction();

                Blog blog = new Blog();
                blog.Name = "Test Blog 1";

                Entry entry = new Entry();
                entry.Subject = "Test Entry 1";

                blog.AddEntry(entry);

                await(session.SaveOrUpdateAsync(blog));

                await(transaction.CommitAsync());
            }
            using (ISession session = OpenSession())
            {
                ITransaction transaction = session.BeginTransaction();
                await(session.DeleteAsync("from Blog"));
                await(transaction.CommitAsync());
            }
        }