Exemplo n.º 1
0
        public void VerifyHistoryOfSite1()
        {
            var ver1 = new SameIdTestEntity1 {
                Id = 1, Str1 = "str1"
            };
            var ver2 = new SameIdTestEntity1 {
                Id = 1, Str1 = "str2"
            };

            Assert.AreEqual(ver1, AuditReader().Find <SameIdTestEntity1>(1, 1));
            Assert.AreEqual(ver2, AuditReader().Find <SameIdTestEntity1>(1, 2));
        }
Exemplo n.º 2
0
        protected override void Initialize()
        {
            var site1 = new SameIdTestEntity1 {
                Id = 1, Str1 = "str1"
            };
            var site2 = new SameIdTestEntity2 {
                Id = 1, Str1 = "str1"
            };

            using (var tx = Session.BeginTransaction())
            {
                Session.Save(site1);
                Session.Save(site2);
                tx.Commit();
            }
            using (var tx = Session.BeginTransaction())
            {
                site1.Str1 = "str2";
                site2.Str1 = "str2";
                tx.Commit();
            }
        }