public async Task <IActionResult> GetAsync()
        {
            var trades = await _tradeRepository.GetAllAsync();

            _logger.LogInformation("Fetched list of all trades.");
            return(Ok(trades));
        }
 public Task <IReadOnlyList <Trade> > GetAllAsync(
     string brokerId, string externalId, long accountId, long walletId, string baseAsset, string quotingAsset,
     ListSortDirection sortOrder = ListSortDirection.Ascending, string cursor = null, int limit = 50)
 {
     return(_tradeRepository.GetAllAsync(brokerId, externalId, accountId, walletId, baseAsset, quotingAsset,
                                         sortOrder, cursor, limit));
 }
        public async Task <IActionResult> GetPortfolioTradesAsync(int id)
        {
            Portfolio           portfolio;
            IEnumerable <Trade> trades;

            try {
                portfolio = await _portfolioRepository.GetAsync(id);

                trades = await _tradeRepository.GetAllAsync(portfolio);
            } catch (InvalidOperationException e) {
                _logger.LogInformation(e, $"Found no user entry with id: {id}.");
                return(NotFound(e.Message));
            }

            return(Ok(trades));
        }