/// <summary>
        /// کمترین قیمت گلد در حال حاضر برگردانده میشود
        /// </summary>
        /// <returns></returns>
        public GoldPriceViewModel Get()
        {
            GoldPriceViewModel GoldPriceViewModel1 = new GoldPriceViewModel();

            PersianDateTime PersianDateTime1 = new PersianDateTime();

            //دریافت قیمت فعلی کلد
            GoldPriceViewModel1.LowestPrice = 1;
            GoldPriceViewModel1.DateTime    = PersianDateTime1.GregorianToShamsi(DateTime.UtcNow);
            return(GoldPriceViewModel1);
        }
Exemple #2
0
        //
        // GET: /Read/GoldPrice/
        public ActionResult Index()
        {
            GoldPriceViewModel GoldPriceNow      = new GoldPriceViewModel();
            string             WebApiHostAddress = System.Configuration.ConfigurationManager.AppSettings["WebApiHostAddress"];
            string             StringApiUrl      = WebApiHostAddress + "/api/GoldPrice";

            using (HttpClient HttpClient = new HttpClient())
            {
                Task <string> response = HttpClient.GetStringAsync(StringApiUrl);
                GoldPriceNow = JsonConvert.DeserializeObjectAsync <GoldPriceViewModel>(response.Result).Result;
            }
            return(View(GoldPriceNow));
        }