private static IBetOperand GetBetOperand(UserDataManager manager, string type, string id, string name) { if (id == null) return null; IBetOperand player = null; if (type == "Team") { player = manager.GetPgTeam(new POCO.TeamBase { _id = id, name = name }); } else if (type == "User") { player = manager.GetPgUser(new POCO.UserBase { _id = id, username = name }); } else throw new Exception("Player type " + type + " not recognized."); return player; }