public async Task UpdateAsync <T>(string connection, T obj) where T : class
 {
     await Task.Run(() => {
         using (var c = new MySqlData.MySqlConnection(connection))
         {
             c.Open();
             c.Update(obj);
             c.Close();
         }
     });
 }
Example #2
0
        public void Update <T>(string connection, T obj) where T : class
        {
            using (var c = new MySqlData.MySqlConnection(connection))
            {
                _log.LogTrace <MySqlQuery>($"UPDATE: {nameof(obj)}. Connection: {connection}. Object: {JsonConvert.SerializeObject(obj)}");

                c.Open();
                c.Update(obj);
                c.Close();
            }
        }
 public async Task UpdateAsync <T>(T obj) where T : class
 {
     await Task.Run(() => {
         using (var connection = new MySqlData.MySqlConnection(_connection))
         {
             connection.Open();
             connection.Update(obj);
             connection.Close();
         }
     });
 }