// GET: Card Id Player public ActionResult PlayerCard(Guid?id) { //Verify player if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Player player = db.Players.Find(id); if (player == null) { return(HttpNotFound()); } //Return an object Card Card myCard = CardHelper.CreateCard(); //Add the player Id myCard.Player = player; //Update the Room Players Line and Bingo and Room message Room myRoom = db.Rooms.Find(myCard.Player.RoomId); myRoom.LinePlayer = Guid.Empty; myRoom.WinnerPlayer = Guid.Empty; myRoom.Message = $"{player.Name} joined the game"; db.SaveChanges(); return(View(myCard)); }
// GET: Card public ActionResult Index() { return(View(CardHelper.CreateCard())); }