/// <summary> /// Get the associated event timeline for single culture /// </summary> /// <param name="id">The id of the sport event to be fetched</param> /// <param name="culture">The language to be fetched</param> /// <returns>The event timeline or empty if not found</returns> public async Task <IEnumerable <ITimelineEvent> > GetTimelineEventsAsync(URN id, CultureInfo culture = null) { culture ??= _defaultCultures.First(); try { LogInt.LogInformation($"Invoked GetTimelineEventsAsync: [Id={id}, Culture={culture.TwoLetterISOLanguageName}]"); var matchTimelineDTO = await _dataRouterManager.GetInformationAboutOngoingEventAsync(id, culture, null).ConfigureAwait(false); if (matchTimelineDTO != null && !matchTimelineDTO.BasicEvents.IsNullOrEmpty()) { var matchTimeline = new EventTimeline(new EventTimelineCI(matchTimelineDTO, culture)); LogInt.LogInformation($"GetTimelineEventsAsync returned {matchTimeline.TimelineEvents?.Count() ?? 0} results."); return(matchTimeline.TimelineEvents); } } catch (Exception e) { LogInt.LogError(e, $"Error executing GetTimelineEventsAsync: [Id={id}, Culture={culture.TwoLetterISOLanguageName}]"); if (_exceptionStrategy == ExceptionHandlingStrategy.THROW) { throw; } return(null); } LogInt.LogInformation("GetTimelineEventsAsync returned 0 results."); return(new List <ITimelineEvent>()); }