Exemplo n.º 1
0
 public async Task DeleteAsync <T>(string connection, T obj) where T : class, IModel
 {
     await Task.Run(() => {
         using (var c = new MySqlData.MySqlConnection(connection))
         {
             c.Open();
             c.Delete(obj);
             c.Close();
         }
     });
 }
Exemplo n.º 2
0
        public void Delete <T>(string connection, T obj) where T : class, IModel
        {
            using (var c = new MySqlData.MySqlConnection(connection))
            {
                _log.LogTrace <MySqlQuery>($"DELETE: {nameof(obj)}. Object: {JsonConvert.SerializeObject(obj)}");

                c.Open();
                c.Delete(obj);
                c.Close();
            }
        }
Exemplo n.º 3
0
 public async Task DeleteAsync <T>(T obj) where T : class, IModel
 {
     await Task.Run(() => {
         using (var connection = new MySqlData.MySqlConnection(_connection))
         {
             connection.Open();
             connection.Delete(obj);
             connection.Close();
         }
     });
 }