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(); }
partial void UpdateUser(User instance);
partial void DeleteUser(User instance);
partial void InsertUser(User instance);