public Transaction GetTransaction(Guid id) { using (var context = new WebWalletApiContext(_optionsBuilder.Options)) { return(context.Transaction.SingleOrDefault(o => o.Id == id)); } }
public BankAccount GetBankAccount(Guid id) { using (var context = new WebWalletApiContext(_optionsBuilder.Options)) { return(context.BankAccount.SingleOrDefault(o => o.Id == id)); } }
public ICollection <Transaction> GetTransactions() { using (var context = new WebWalletApiContext(_optionsBuilder.Options)) { return(context.Transaction.ToList()); } }
public ICollection <BankAccount> GetBankAccounts() { using (var context = new WebWalletApiContext(_optionsBuilder.Options)) { return(context.BankAccount.ToList()); } }
public void UpdateTransaction(Transaction bankAccount) { using (var context = new WebWalletApiContext(_optionsBuilder.Options)) { context.Transaction.Update(bankAccount); context.SaveChanges(); } }
public void UpdateBankAccount(BankAccount bankAccount) { using (var context = new WebWalletApiContext(_optionsBuilder.Options)) { context.BankAccount.Update(bankAccount); context.SaveChanges(); } }
public void DeleteTransaction(Guid id) { using (var context = new WebWalletApiContext(_optionsBuilder.Options)) { var transaction = GetTransaction(id); context.Transaction.Remove(transaction); context.SaveChanges(); } }
public void DeleteBankAccount(Guid id) { using (var context = new WebWalletApiContext(_optionsBuilder.Options)) { var bankAccount = GetBankAccount(id); context.BankAccount.Remove(bankAccount); context.SaveChanges(); } }
public BankAccountRepository(WebWalletApiContext context) : base(context) { }
public UnitOfWork(WebWalletApiContext context) { _context = context; BankAccounts = new BankAccountRepository(_context); Transactions = new TransactionRepository(_context); }