Example #1
0
        public void VerifyHistory()
        {
            var ver1 = new JoinTestEntity {
                Id = id, S1 = "a", S2 = "1"
            };
            var ver2 = new JoinTestEntity {
                Id = id, S1 = "b", S2 = "2"
            };

            Assert.AreEqual(ver1, AuditReader().Find <JoinTestEntity>(id, 1));
            Assert.AreEqual(ver2, AuditReader().Find <JoinTestEntity>(id, 2));
        }
Example #2
0
        protected override void Initialize()
        {
            var ste = new JoinTestEntity {
                S1 = "a", S2 = "1"
            };

            using (var tx = Session.BeginTransaction())
            {
                id = (int)Session.Save(ste);
                tx.Commit();
            }
            using (var tx = Session.BeginTransaction())
            {
                ste.S1 = "b";
                ste.S2 = "2";
                tx.Commit();
            }
        }