public ActionResult GetTickerQuotes() { var marketQuotes = _MarketRepository.GetMarketTickerQuotes(); var securityQuotes = _SecurityRepository.GetSecurityTickerQuotes(); marketQuotes.AddRange(securityQuotes); var news = _MarketRepository.GetMarketNews(); return(Json(new { Markets = marketQuotes, News = news }, JsonRequestBehavior.AllowGet)); }
public MarketsAndNews TickerQuotes() { var marketQuotes = _MarketRepository.GetMarketTickerQuotes(); var securityQuotes = _SecurityRepository.GetSecurityTickerQuotes(); marketQuotes.AddRange(securityQuotes); var news = _MarketRepository.GetMarketNews(); if (marketQuotes == null && news == null) { throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.NotFound)); } return(new MarketsAndNews { Markets = marketQuotes, News = news }); }