//Get api/wallettransaction public IHttpActionResult GetWalletTransactions() { WalletTransactionService walletTransactionService = CreateWalletTransactionService(); var transactions = walletTransactionService.GetWalletTransactions(); return(Ok(transactions)); }
//Get api/wallettransaction/id public IHttpActionResult GetWalletTransactions(int id) { WalletTransactionService walletTransactionService = CreateWalletTransactionService(); var transaction = walletTransactionService.GetWalletTransactionById(id); return(Ok(transaction)); }
private WalletTransactionService CreateWalletTransactionService() { var userId = Guid.Parse(User.Identity.GetUserId()); var walletService = new WalletService(userId); var service = new WalletTransactionService(userId, walletService.GetWalletId()); return(service); }
public WalletController(WalletTransactionService walletTransactionService, IWalletTransactionQuery walletTransactionQuery) { this.walletTransactionService = walletTransactionService; this.walletTransactionQuery = walletTransactionQuery; }