public async Task <Transaction> GetTransaction(Guid transactionID) { using (PaymentGatewayEntities DB = new PaymentGatewayEntities()) { return(await DB.Transactions.FindAsync(transactionID)); } }
public async Task <List <Transaction> > GetTransactions(Guid merchantAccountID) { using (PaymentGatewayEntities DB = new PaymentGatewayEntities()) { return(await DB.Transactions.Where(x => x.MerchantAccountID == merchantAccountID).ToListAsync()); } }
public async Task AddTransaction(Transaction transaction) { using (PaymentGatewayEntities DB = new PaymentGatewayEntities()) { DB.Transactions.Add(transaction); await DB.SaveChangesAsync(); } }