public async Task DeleteBankAccountAsync(long BankAccountK) { IBankAccount account = GetBankAccount(BankAccountK); int affected = 0; try { if (account == null || (affected = await Connection.QueryAsync("DELETE FROM `bank_account` WHERE `bank_account_id` = @0", BankAccountK)) == 0) { return; } } catch (Exception ex) { TShock.Log.ConsoleError("seconomy mysql: DeleteBankAccount failed: {0}", ex.Message); } if (affected != 1) { TShock.Log.ConsoleError("seconomy mysql: DeleteBankAccount affected {0} rows where it should have only been 1.", affected); return; } lock (BankAccounts) { BankAccounts.RemoveAll(i => i.BankAccountK == BankAccountK); } }