コード例 #1
0
        public IActionResult Index()
        {
            CatRandomizer randy = new CatRandomizer();

            randy.ChooseCandidates();
            ViewBag.first       = Cats.cats[randy.firstIndex].url;
            ViewBag.firstIndex  = randy.firstIndex;
            ViewBag.sec         = Cats.cats[randy.secondIndex].url;
            ViewBag.secondIndex = randy.secondIndex;
            return(View());
        }
コード例 #2
0
        public IActionResult Voted(int catIndex)
        {
            Cats.AddVote(catIndex);

            CatRandomizer randy = new CatRandomizer();

            randy.ChooseCandidates();
            ViewBag.first       = Cats.cats[randy.firstIndex].url;
            ViewBag.sec         = Cats.cats[randy.secondIndex].url;
            ViewBag.firstIndex  = randy.firstIndex;
            ViewBag.secondIndex = randy.secondIndex;

            return(View("Index"));
        }