Ejemplo n.º 1
0
        public async Task <ActionResult <Quote> > GetDate(string symbol, DateTime date)
        {
            Equity equity = await eMgr.GetBySymbol(symbol);

            Quote quoteList = new Quote();

            if (equity == default(Equity))
            {
                return(BadRequest(quoteList));
            }
            else
            {
                quoteList = await qMgr.GetByEquityIdAndDate(equity.Id, date);

                if (quoteList == null)
                {
                    return(BadRequest(quoteList));
                }
            }
            return(Ok(quoteList));
        }
Ejemplo n.º 2
0
        public async Task <ActionResult <Quote> > GetDate(string symbol, DateTime date)
        {
            Equity equity = await eMgr.GetBySymbol(symbol);

            ManagerResult <Quote> mrQuoteList = new ManagerResult <Quote>();

            if (equity == default)
            {
                mrQuoteList.Success = false;
                mrQuoteList.Entity  = new Quote();
                mrQuoteList.Message = $"Error getting symbol: {symbol}";
                return(BadRequest(mrQuoteList));
            }
            else
            {
                mrQuoteList = await qMgr.GetByEquityIdAndDate(equity.Id, date);

                if (!mrQuoteList.Success)
                {
                    return(BadRequest(mrQuoteList));
                }
            }
            return(Ok(mrQuoteList.Entity));
        }