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(); } }
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(); } }
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(); } }