public OLobbyRoom CreateLobby(OPlayer host) { var maxLobId = (from lobMaxId in dc.Lobbies select lobMaxId.LobbyId).Max(); Lobby lobby = new Lobby(); lobby.LobbyName = host.PlayerName + "'s lobby"; lobby.LobbyId = ++maxLobId; lobby.IsWaitingForPlayers = true; lobby.IsUpdate = false; lobby.DiceRollllllllllllllllllllol = 0; PlayLobby pLobby = new PlayLobby(); pLobby.HostPlayer = host.PlayerId; pLobby.LobbyId = lobby.LobbyId; pLobby.PlayerId = host.PlayerId; dc.PlayLobbies.InsertOnSubmit(pLobby); dc.Lobbies.InsertOnSubmit(lobby); dc.SubmitChanges(); return new OLobbyRoom { HostPlayer = host, PlayerList = new List<OPlayer> { host }, TheLobby = new OLobby { LobbyId = lobby.LobbyId, LobbyName = lobby.LobbyName, IsUpdate = false } }; }
partial void DeletePlayLobby(PlayLobby instance);
partial void UpdatePlayLobby(PlayLobby instance);
partial void InsertPlayLobby(PlayLobby instance);