コード例 #1
0
        public void LogChanges_Insert()
        {
            var tbl = new Rowset(Schema.GetForTypedDoc(typeof(Person)));

            tbl.LogChanges = true;

            tbl.Insert(new Person {
                ID           = "POP1",
                FirstName    = "Oleg",
                LastName     = "Popov",
                DOB          = new DateTime(1953, 12, 10),
                YearsInSpace = 12
            });


            Aver.AreEqual(1, tbl.ChangeCount);

            Aver.IsTrue(DocChangeType.Insert == tbl.GetChangeAt(0).Value.ChangeType);
        }
コード例 #2
0
ファイル: Rowsets.cs プロジェクト: filmor/nfx
        public void LogChanges_Update()
        {
            var tbl = new Rowset(Schema.GetForTypedRow(typeof(Person)));


            tbl.Insert(new Person {
                ID           = "POP1",
                FirstName    = "Oleg",
                LastName     = "Popov",
                DOB          = new DateTime(1953, 12, 10),
                YearsInSpace = 12
            });
            tbl.LogChanges = true;

            tbl.Update(tbl[0]);


            Assert.AreEqual(1, tbl.ChangeCount);

            Assert.AreEqual(RowChangeType.Update, tbl.GetChangeAt(0).Value.ChangeType);
        }