コード例 #1
0
        public IActionResult Feed()
        {
            Dojodachi dojo = DojodachiHelper.Get(HttpContext);

            dojo.Feed();
            DojodachiHelper.Save(HttpContext, dojo);
            return(RedirectToAction("Index"));
        }
コード例 #2
0
        public IActionResult Feed()
        {
            Dojodachi pet = HttpContext.Session.GetObjectFromJson <Dojodachi>("Pet");

            TempData["Message"] = pet.Feed();
            TempData["End"]     = pet.Check();
            HttpContext.Session.SetObjectAsJson("Pet", pet);
            return(RedirectToAction("Index"));
        }