예제 #1
0
        public void VerifyHistory()
        {
            var ver1 = new FieldAccessEntity {
                Id = id
            };

            ver1.SetData("first");
            var ver2 = new FieldAccessEntity {
                Id = id
            };

            ver2.SetData("second");

            Assert.AreEqual(ver1, AuditReader().Find <FieldAccessEntity>(id, 1));
            Assert.AreEqual(ver2, AuditReader().Find <FieldAccessEntity>(id, 2));
        }
예제 #2
0
        protected override void Initialize()
        {
            var fa = new FieldAccessEntity();

            fa.SetData("first");
            using (var tx = Session.BeginTransaction())
            {
                id = (int)Session.Save(fa);
                tx.Commit();
            }
            using (var tx = Session.BeginTransaction())
            {
                fa.SetData("second");
                tx.Commit();
            }
        }