Beispiel #1
0
        public async Task <ActionResult <string> > Get(string id)
        {
            StockDataHandler handler = new StockDataHandler();
            StockSymbol      symbol  = await handler.GetStockDataAsync(id, new TimeSpan(7, 0, 0, 0));

            return(JsonConvert.SerializeObject(symbol));
        }
Beispiel #2
0
        public async Task <ActionResult <string> > Put(string id, [FromBody] string value)
        {
            StockDataHandler handler = new StockDataHandler();
            StockSymbol      data    = await handler.UpsertStockDataAsync(id);

            return(JsonConvert.SerializeObject(data));
        }
Beispiel #3
0
        public ActionResult <IEnumerable <string> > Get()
        {
            StockDataHandler handler = new StockDataHandler();
            //handler.UpsertStockData("MSFT");
            StockSymbol symbol = handler.GetStockData("MSFT");

            if (symbol == null)
            {
                return new string[] { "null", "value2" }
            }
            ;
            return(new string[] { symbol.Symbol, "value2" });
        }