public void Delete(int id) { var deleteCustomer = Read(id); _bankdbContext.Remove(deleteCustomer); _bankdbContext.SaveChanges(); return; }
public void Delete(int id) { var customer = Read(id); _context.Remove(customer); _context.SaveChanges(); return; }
public void Delete(string iban) { var deleteAccount = Read(iban); _bankdbContext.Remove(deleteAccount); _bankdbContext.SaveChanges(); return; }
public void RemoveAccount(Account account) { using (var context = new BankdbContext()) try { context.Remove(account); context.SaveChanges(); } catch (Exception ex) { throw new NotImplementedException($"{ex.Message}\n{ex.InnerException.Message}"); } }
public void Delete(long id) { var deletedAccount = ReadById(id); if (deletedAccount != null) { _BankdbContext.Remove(deletedAccount); _BankdbContext.SaveChanges(); Console.WriteLine("Tiedot poistettu onnistuneesti."); } else { Console.WriteLine("Tiedon poisto EI onnistunut."); } }
public void RemoveBank(Bank bank) { using (var context = new BankdbContext()) { try { //Lisätään tai poistetaan tapahtumataulun rivi context.Remove(bank); //Tallennetaan muutokset tietokantaan context.SaveChanges(); } catch (Exception ex) { throw new NotImplementedException($"{ex.Message}\n{ex.InnerException.Message}"); } } }
public void DeleteAccount(Account account) { _bankdbContext.Remove(account); _bankdbContext.SaveChanges(); }
public void Delete(string IBAN) { _context.Remove(IBAN); _context.SaveChanges(); return; }