public static void DeleteAccount(int accountNo) { var account = BankFactory.GetAccountDetails(accountNo); db.Accounts.Remove(account); db.SaveChanges(); }
public static void EditAccount(Account updatedAccount) { var oldAccount = BankFactory.GetAccountDetails(updatedAccount.AccountNumber); oldAccount.EmailAddress = updatedAccount.EmailAddress; oldAccount.AccountType = updatedAccount.AccountType; db.Update(oldAccount); db.SaveChanges(); }