Exemplo n.º 1
0
        public async Task <IActionResult> PrivacyAsync()
        {
            var user = User as ClaimsPrincipal;

            ViewBag.UserName = user?.FindFirstValue("name");
            var cacheEntry = cache.GetString("AccessToken");

            if (cacheEntry == null)
            {
                cacheEntry = await forecastService.Get();

                cache.SetString("AccessToken", cacheEntry);
            }
            ViewBag.Access_Token = cacheEntry;
            return(View());
        }