Beispiel #1
0
        public static async Task ASYNC_InsertInTransaction_Commit_TypedRow(ICrudDataStore store)
        {
            var transaction = store.BeginTransactionAsync().Result;

            var tasks = new List <Task>();

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

            Task.WaitAll(tasks.ToArray());


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

            Aver.AreEqual(0, got[0].Count);

            transaction.Commit();

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

            Aver.AreEqual(25, got[0].Count);
        }