コード例 #1
0
 public IActionResult Index()
 {
     var vm = new FlipScript.ViewModels.Home.Index();
     if (HttpContext.Request.Cookies.ContainsKey("gitHubUrls"))
     {
         string cookie = HttpContext.Request.Cookies["gitHubUrls"];
         var cookieUrls = cookie.Split(new string[] { "----" }, StringSplitOptions.None);
         vm.PreviousUrls = cookieUrls.ToList();
     }
     else
     {
         vm.PreviousUrls = new List<string>();
     }
     return View(vm);
 }
コード例 #2
0
        public IActionResult Index()
        {
            var vm = new FlipScript.ViewModels.Home.Index();

            if (HttpContext.Request.Cookies.ContainsKey("gitHubUrls"))
            {
                string cookie     = HttpContext.Request.Cookies["gitHubUrls"];
                var    cookieUrls = cookie.Split(new string[] { "----" }, StringSplitOptions.None);
                vm.PreviousUrls = cookieUrls.ToList();
            }
            else
            {
                vm.PreviousUrls = new List <string>();
            }
            return(View(vm));
        }