// todo remove once all code uses new XSD classes protected T GetGameInfo <T>(Uri sportRadarUri) where T : class { string gameInfoXmlString = ReadResponseFromUri(sportRadarUri); StringReader stringReader = new StringReader(gameInfoXmlString); T gameInfoXml = (T)GameInfoXmlSerializer.Deserialize(stringReader); return(gameInfoXml); }
public NflGameInfo GetGameSummary(Guid gameId) { // the SportRadar game boxscore and game summary use the same schema and base URL Uri gameSummaryUri = GetGameSummaryUri(gameId); string gameSummaryString = ReadResponseFromUri(gameSummaryUri); StringReader stringReader = new StringReader(gameSummaryString); if (GameInfoXmlSerializer == null) { GameInfoXmlSerializer = new XmlSerializer(typeof(NflGameInfo)); } NflGameInfo nflGameSummary = (NflGameInfo)GameInfoXmlSerializer.Deserialize(stringReader); return(nflGameSummary); }
public NhlGameInfo GetGameSummary(Guid gameId) { try { // the SportRadar game boxscore and game summary use the same schema and base URL Uri gameSummaryUri = GetGameSummaryUri(gameId); string gameSummaryString = ReadResponseFromUri(gameSummaryUri); StringReader stringReader = new StringReader(gameSummaryString); if (GameInfoXmlSerializer == null) { GameInfoXmlSerializer = new XmlSerializer(typeof(NhlGameInfo)); } NhlGameInfo nhlNhlGameInfo = (NhlGameInfo)GameInfoXmlSerializer.Deserialize(stringReader); return(nhlNhlGameInfo); } catch (Exception e) { Logger.Info(e); return(new NhlGameInfo()); } }