Exemple #1
0
        public List <Intraday> Add([FromBody] Intraday intraday)
        {
            Intraday newItem = new Intraday();

            newItem.P         = intraday.P;
            newItem.V         = intraday.V;
            newItem.dateAdded = DateTime.Now.ToString();

            DbContext.Add(newItem);
            //DbContext.SaveChanges();
            return(DbContext.Intraday.ToList());
        }
Exemple #2
0
        private Intraday GetIntraday(int idtAsset)
        {
            Intraday intraday    = new Intraday();
            string   urlRequest  = new Utils().UrlBuild("API_Access:UrlBase", "API_Access:IntradayService", idtAsset.ToString());
            string   respApiJson = new ServiceRequester().GetRequest(urlRequest);

            respApiJson = respApiJson.Replace("uolfinancecallback0(", "").Replace(");", "");

            if (!string.IsNullOrEmpty(respApiJson))
            {
                intraday = JsonConvert.DeserializeObject <Intraday>(respApiJson);
            }

            return(intraday);
        }