[Route("/")]
public async Task<IActionResult> Index()
{
string stockSymbol = _options.DefaultStockSymbol;
if (string.IsNullOrEmpty(stockSymbol))
{
stockSymbol = "MSFT";
}
Dictionary<string, object> profile = await finnhubService.GetCompanyProfile(stockSymbol); //returns json data
Dictionary<string, object> price = await _finnhubService.GetStockPriceQuote(stockSymbol);
StockTrade stockTrade = new StockTrade
{
StockSymbol = stockSymbol,
StockName = profile.ContainsKey("name") ? profile["name"].ToString() : null,
//Price = price.ContainsKey("c") ? price["c"].GetDouble() : 0.0
};
return View(stockTrade);
}
[Route("/")]
public async Task<IActionResult> Index()
{
string stockSymbol = _options.DefaultStockSymbol;
if (string.IsNullOrEmpty(stockSymbol))
{
stockSymbol = "MSFT";
}
Dictionary<string, object> profile = await finnhubService.GetCompanyProfile(stockSymbol); //returns json data
Dictionary<string, object> price = await _finnhubService.GetStockPriceQuote(stockSymbol);
StockTrade stockTrade = new StockTrade
{
StockSymbol = stockSymbol,
StockName = profile.ContainsKey("name") ? profile["name"].ToString() : null,
//Price = price.ContainsKey("c") ? price["c"].GetDouble() : 0.0
};
return View(stockTrade);
}