Пример #1
0
        public void VerifyHistoryOfId1()
        {
            var ver1 = new SerializableTestEntity {
                Id = id1, Obj = new SerObj {
                    Data = "d1"
                }
            };
            var ver2 = new SerializableTestEntity {
                Id = id1, Obj = new SerObj {
                    Data = "d2"
                }
            };

            Assert.AreEqual(ver1, AuditReader().Find <SerializableTestEntity>(id1, 1));
            Assert.AreEqual(ver2, AuditReader().Find <SerializableTestEntity>(id1, 2));
        }
Пример #2
0
        protected override void Initialize()
        {
            var ste = new SerializableTestEntity {
                Obj = new SerObj {
                    Data = "d1"
                }
            };

            using (var tx = Session.BeginTransaction())
            {
                id1 = (int)Session.Save(ste);
                tx.Commit();
            }
            using (var tx = Session.BeginTransaction())
            {
                ste.Obj = new SerObj {
                    Data = "d2"
                };
                tx.Commit();
            }
        }