/// <summary>
 /// Get all of the stock information from TWSE web site
 /// </summary>
 /// <returns></returns>
 public async Task<List<StockInfoItem>> GetAllStockInfoAsync()
 {
     TwseStockClient client = new TwseStockClient();
     var stockList = await client.GetAllStockInfoAsync();
     List<StockInfoItem> resultList = new List<StockInfoItem>();
     foreach (var item in stockList)
     {
         resultList.Add(new StockInfoItem
         {
             Id = item.Id,
             Category = item.Category,
             MarketType = item.MarketType,
             Name = item.Name
         });
     }
     return resultList;
 }
        public async Task<List<RealTimeStockItem>> GetMultipleRealTimeStockAsync(List<StockInfoItem> stockList)
        {
            // hard code to display taiwan tse stock
            stockList.Insert(0, new StockInfoItem { Id = "t00", MarketType = "上市" });


            SessionData session = await GetSession();
            List<StockInfoModel> queryStockList = stockList.Convert();
            
            List<RealTimeStockModel> results = new List<RealTimeStockModel>();
            try
            {
                TwseStockClient client = new TwseStockClient();
                results = await client.QueryStockAsync(queryStockList, session);
            }
            catch (Exception e)
            {
                Debug.WriteLine(DateTime.Now + " : " + "Cookie time out");
                ReleaseSession();
            }

            return results.Convert();
        }
 public async Task<StockChartModel> GetRealTimeTradeChartAsync(StockInfoItem stockItem)
 {
     TwseStockClient client = new TwseStockClient();
     var resutl = await client.QueryRealTimeTradeChartAsync(stockItem.Convert());
     return resutl;
 }