Exemple #1
0
        public async Task <IActionResult> GetStocks()
        {
            var stocks = await _stocksRepository.GetAll(Request.GetAuthenticatedUser());

            var result = new UserStocksResultModel()
            {
                Stocks = stocks.Select(rm => new UserStockResultModel()
                {
                    Name   = rm.Name,
                    Amount = rm.Amount
                })
            };

            return(Ok(result));
        }