예제 #1
0
        public void VerifyHistory()
        {
            var ver1 = new BasicTestEntity4 {
                Id = id1, Str1 = "x", Str2 = "y"
            };
            var ver2 = new BasicTestEntity4 {
                Id = id1, Str1 = "a", Str2 = "b"
            };

            Assert.AreEqual(ver1, AuditReader().Find <BasicTestEntity4>(id1, 1));
            Assert.AreEqual(ver2, AuditReader().Find <BasicTestEntity4>(id1, 2));
        }
예제 #2
0
        protected override void Initialize()
        {
            var bte1 = new BasicTestEntity4 {
                Str1 = "x", Str2 = "y"
            };

            using (var tx = Session.BeginTransaction())
            {
                id1 = (int)Session.Save(bte1);
                tx.Commit();
            }
            using (var tx = Session.BeginTransaction())
            {
                bte1.Str1 = "a";
                bte1.Str2 = "b";
                tx.Commit();
            }
        }