コード例 #1
0
        public ActionResult CreateFeed(int id)
        {
            Tama tamagotchi = Tama.Find(id);

            tamagotchi.Feed();
            return(View("Details", tamagotchi));
        }
コード例 #2
0
        public ActionResult CreateFeed(int id)
        {
            Tama        tamagotchi = Tama.Find(id);
            List <Tama> allTama    = Tama.GetAll();

            tamagotchi.Feed();
            Tama.CheckForDead();
            return(tamagotchi.IsDead() ? RedirectToAction("Index", allTama) : RedirectToAction("Details", tamagotchi));
        }