public IActionResult Play() { int? index = HttpContext.Session.GetInt32("userid"); MonsterObject userMonster = dbContext.Monsters .Where(m => m.UserId == index) .FirstOrDefault(); userMonster.Play(); dbContext.SaveChanges(); return(Redirect("/monster")); }