Exemplo n.º 1
0
        protected override void OnSetUp()
        {
            // Clear cache at each test.
            RebuildSessionFactory();
            using (var session = OpenSession())
                using (var tx = session.BeginTransaction())
                {
                    for (var i = 0; i < 5; i++)
                    {
                        var obj = new ItemWithLazyProperty
                        {
                            Id          = i + 1,
                            Name        = "Name #" + i,
                            Description = "Description #" + i,
                        };
                        session.Save(obj);
                    }

                    tx.Commit();
                }
        }
Exemplo n.º 2
0
        protected override void OnSetUp()
        {
            cfg.Properties[Environment.CacheProvider] = typeof(BinaryFormatterCacheProvider).AssemblyQualifiedName;
            cfg.Properties[Environment.UseQueryCache] = "true";
            sessions = (ISessionFactoryImplementor)cfg.BuildSessionFactory();

            using (var session = OpenSession())
                using (var tx = session.BeginTransaction())
                {
                    for (var i = 0; i < 5; i++)
                    {
                        var obj = new ItemWithLazyProperty
                        {
                            Id          = i + 1,
                            Name        = "Name #" + i,
                            Description = "Description #" + i,
                        };
                        session.Save(obj);
                    }

                    tx.Commit();
                }
        }
Exemplo n.º 3
0
		protected override void OnSetUp()
		{
			cfg.Properties[Environment.CacheProvider] = typeof (BinaryFormatterCacheProvider).AssemblyQualifiedName;
			cfg.Properties[Environment.UseQueryCache] = "true";
			sessions = (ISessionFactoryImplementor) cfg.BuildSessionFactory();

			using (var session = OpenSession())
			using (var tx = session.BeginTransaction())
			{
				for (var i = 0; i < 5; i++)
				{
					var obj = new ItemWithLazyProperty
								  {
									  Id = i + 1,
									  Name = "Name #" + i,
									  Description = "Description #" + i,
								  };
					session.Save(obj);
				}

				tx.Commit();
			}
		}