Ejemplo n.º 1
0
 public void TestDeleteByMultipleKeyObjectWithAttributes()
 {
     using (var connection = GetOpenConnection())
     {
         var keyMaster = new KeyMaster {
             Key1 = 1, Key2 = 2
         };
         connection.Insert(keyMaster);
         var car = connection.Get <KeyMaster>(new { Key1 = 1, Key2 = 2 });
         connection.Delete(car);
         connection.Get <KeyMaster>(keyMaster).IsNull();
     }
 }
Ejemplo n.º 2
0
 public void TestMultipleKeyGetAsync()
 {
     using (var connection = GetOpenConnection())
     {
         var keyMaster = new KeyMaster {
             Key1 = 1, Key2 = 2
         };
         connection.Insert(keyMaster);
         var result = connection.GetAsync <KeyMaster>(new { Key1 = 1, Key2 = 2 });
         result.Result.Key1.IsEqualTo(1);
         result.Result.Key2.IsEqualTo(2);
         connection.Delete(keyMaster);
     }
 }
Ejemplo n.º 3
0
        public async void TestInsertWithMultiplePrimaryKeysAsync()
        {
            using (var connection = GetOpenConnection())
            {
                var keyMaster = new KeyMaster {
                    Key1 = 1, Key2 = 2
                };
                await connection.InsertAsync(keyMaster);

                var result = connection.GetAsync <KeyMaster>(new { Key1 = 1, Key2 = 2 });
                result.Result.Key1.IsEqualTo(1);
                result.Result.Key2.IsEqualTo(2);
                connection.Execute("Delete from KeyMaster");
            }
        }