Exemplo n.º 1
0
        public static void ASYNC_InsertManyUsingLogChanges_TypedRow(ICRUDDataStore store)
        {
            var rowset = new Rowset(Schema.GetForTypedRow(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.SaveAsync(rowset).Wait();

            var task = store.LoadAsync(new Query("CRUD.Patient.List", typeof(Patient))
            {
                new Query.Param("LN", "%loff%")
            });

            Assert.AreEqual(1000, task.Result[0].Count);

            task = store.LoadAsync(new Query("CRUD.Patient.List", typeof(Patient))
            {
                new Query.Param("LN", "%ovich%")
            });

            Assert.AreEqual(327, task.Result[0].Count);
        }
Exemplo n.º 2
0
        public static void ASYNC_InsertManyUsingLogChanges_TypedRow(ICRUDDataStore store)
        {
            var rowset = new Rowset( Schema.GetForTypedRow(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.SaveAsync( rowset ).Wait();

            var task = store.LoadAsync( new Query("CRUD.Patient.List", typeof(Patient) ) { new Query.Param("LN", "%loff%") } );
            
            Assert.AreEqual(1000, task.Result[0].Count);

            task = store.LoadAsync( new Query("CRUD.Patient.List", typeof(Patient) ) { new Query.Param("LN", "%ovich%") } );
            
            Assert.AreEqual(327, task.Result[0].Count);
        }