Beispiel #1
0
        public static void InsertManyUsingLogChanges_TypedRow(ICrudDataStore store)
        {
            var rowset = new Rowset(Schema.GetForTypedDoc(typeof(Patient)));

            rowset.LogChanges = true;

            for (var i = 0; i < 1000; i++)
            {
                rowset.Insert(new Patient
                {
                    SSN        = "999-88-9012",
                    First_Name = "Jack",
                    Last_Name  = "Kozloff" + i,
                    DOB        = new DateTime(1980, 1, 12)
                });
            }

            for (var i = 0; i < 327; i++)
            {
                rowset.Insert(new Patient
                {
                    SSN        = "999-88-9012",
                    First_Name = "Jack",
                    Last_Name  = "Abramovich" + i,
                    DOB        = new DateTime(2001, 1, 12)
                });
            }

            store.Save(rowset);

            var result = store.Load(new Query("CRUD.Queries.Patient.List", typeof(Patient))
            {
                new Query.Param("LN", "%loff%")
            })[0];

            Aver.AreEqual(1000, result.Count);

            result = store.Load(new Query("CRUD.Queries.Patient.List", typeof(Patient))
            {
                new Query.Param("LN", "%ovich%")
            })[0];

            Aver.AreEqual(327, result.Count);
        }