public IActionResult Spin(Player player) { // Create a Spin with its data Spin spin = new Spin { Luck = player.LuckyNumber, A = random.Next(1, 10), B = random.Next(1, 10), C = random.Next(1, 10) }; spin.IsWinner = (spin.A == spin.Luck || spin.B == spin.Luck || spin.C == spin.Luck); // Store some View data ViewBag.Display = spin.IsWinner ? "block" : "none"; ViewBag.FirstName = player.FirstName; //TODO: add the spin to the Spin Repository repository.AddSpins(spin); return(View(spin)); }