示例#1
0
        public void DeleteSync()
        {
            ClearDapperCompisiteKeyEntity();
            var d1 = CreateDapperCompisiteKeyEntity();

            try
            {
                _dapper.DeleteAsync(d1).GetAwaiter().GetResult();
                var sql   = $"select count(*) from dapper_compisite_key where products_id = {d1.products_id} and language_id = {d1.language_id}";
                var count = helper.GetValue(sql, Convert.ToInt32);
                Assert.Equal(count, 0);
            }
            finally
            {
                ClearDapperCompisiteKeyEntity();
            }
        }
示例#2
0
 public void DeleteSync()
 {
     ClearTestEntity();
     try
     {
         var d1 = CreateTestEntity();
         _dapper.DeleteAsync(new DapperAllTest {
             Id = d1.Id
         }).GetAwaiter().GetResult();
         var sql   = string.Format("select count(*) from DapperAllTest where id = {0}", d1.Id);
         int count = helper.GetValue(sql, Convert.ToInt32);
         Assert.Equal(0, count);
     }
     finally
     {
         ClearTestEntity();
     }
 }
示例#3
0
        public virtual async Task <bool> DeleteAsync(int id)
        {
            var item = repository.FindById(id);

            return(await repository.DeleteAsync(item));
        }