コード例 #1
0
        public void PlaceUserOnFreeSeat(Game game, User user, int gameActionID)
        {
            int freeSeat = GetFreeSeat(game);
            UserSeat seat = new UserSeat()
            {
                GameID = game.GameID,
                Seat = freeSeat,
                UserID = user.UserID
            };
            ctx.UserSeat.InsertOnSubmit(seat);
            ctx.SubmitChanges();

            Console.WriteLine(String.Format("{0} is placed on seat {1}.", user.Name, freeSeat));

            GameAction action = ctx.GameAction.Single(ga => ga.GameActionID == gameActionID);
            action.Data = seat.Seat.ToString();

            action.IsCommitted = true;
            ctx.SubmitChanges();
        }
コード例 #2
0
 partial void UpdateUser(User instance);
コード例 #3
0
 partial void DeleteUser(User instance);
コード例 #4
0
 partial void InsertUser(User instance);