public async Task <IHttpActionResult> GetStockPrice(int id) { Stock stock = await Db.Stocks.FindAsync(id); if (stock == null) { return(NotFound()); } var price = await StockHelper.GetStockPrice(stock.Ticker); if (price < 0) { return(NotFound()); } return(Ok(price)); }
public async Task <float> GetCurrentPrice() { return(await StockHelper.GetStockPrice(Ticker)); }