public void LoadAllGameGroupsToRedis() { using (var db = new retrospyContext()) { var names = from gl in db.Grouplist join g in db.Games on gl.Gameid equals g.Gameid select g.Gamename; names = names.Distinct(); foreach (var gameName in names) { var result = PeerGroup.SearchPeerGroupKeys(gameName); if (result.Count() != 0) { continue; } _peerGroup.Add(LoadGameRooms(gameName)); PeerGroup.SetGroupList(gameName, LoadGameRooms(gameName)); } } }