public void Delete(int id)
        {
            var deleteCustomer = Read(id);

            _bankdbContext.Remove(deleteCustomer);
            _bankdbContext.SaveChanges();
            return;
        }
Esempio n. 2
0
        public void Delete(int id)
        {
            var customer = Read(id);

            _context.Remove(customer);
            _context.SaveChanges();
            return;
        }
Esempio n. 3
0
        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.");
            }
        }
Esempio n. 6
0
 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}");
         }
     }
 }
Esempio n. 7
0
 public void DeleteAccount(Account account)
 {
     _bankdbContext.Remove(account);
     _bankdbContext.SaveChanges();
 }
Esempio n. 8
0
 public void Delete(string IBAN)
 {
     _context.Remove(IBAN);
     _context.SaveChanges();
     return;
 }