Пример #1
0
        /// <summary>
        /// Asynchronous export item's properties
        /// </summary>
        /// <returns>An <see cref="ExportableCI"/> instance containing all relevant properties</returns>
        public async Task <ExportableFixtureCI> ExportAsync()
        {
            var scheduledTasks = ScheduledStartTimeChanges?.Select(async s => await((ScheduledStartTimeChange)s).ExportAsync().ConfigureAwait(false)).ToList();

            if (!scheduledTasks.IsNullOrEmpty())
            {
                await Task.WhenAll(scheduledTasks).ConfigureAwait(false);
            }
            var channelTasks = TvChannels?.Select(async c => await((TvChannel)c).ExportAsync().ConfigureAwait(false)).ToList();

            return(new ExportableFixtureCI
            {
                ExtraInfo = ExtraInfo?.ToDictionary(i => i.Key, i => i.Value),
                CoverageInfo = CoverageInfo != null?await((CoverageInfo)CoverageInfo).ExportAsync().ConfigureAwait(false) : null,
                                   ProductInfo = ProductInfo != null?await((ProductInfo)ProductInfo).ExportAsync().ConfigureAwait(false) : null,
                                                     ReplacedBy = ReplacedBy?.ToString(),
                                                     References = References?.References?.ToDictionary(r => r.Key, r => r.Value),
                                                     NextLiveTime = NextLiveTime,
                                                     StartTimeConfirmed = StartTimeConfirmed,
                                                     ScheduledStartTimeChanges = scheduledTasks.IsNullOrEmpty() ? null : scheduledTasks.Select(s => s.Result).ToList(),
                                                     StartTime = StartTime,
                                                     TvChannels = channelTasks.IsNullOrEmpty() ? null : channelTasks.Select(s => s.Result).ToList(),
                                                     StartTimeTBD = StartTimeTBD,
                                                     ParentStageId = ParentStageId?.ToString(),
                                                     AdditionalParentsIds = AdditionalParentsIds?.Select(s => s.ToString()).ToList()
            });
        }
Пример #2
0
        /// <summary>
        /// Asynchronous export item's properties
        /// </summary>
        /// <returns>An <see cref="ExportableCI"/> instance containing all relevant properties</returns>
        public async Task <ExportableFixtureCI> ExportAsync()
        {
            var scheduledTasks = ScheduledStartTimeChanges?.Select(async s => await((ScheduledStartTimeChange)s).ExportAsync().ConfigureAwait(false));
            var channelTasks   = TvChannels?.Select(async c => await((TvChannel)c).ExportAsync().ConfigureAwait(false));

            return(new ExportableFixtureCI
            {
                ExtraInfo = ExtraInfo?.ToDictionary(i => i.Key, i => i.Value),
                CoverageInfo = CoverageInfo != null?await((CoverageInfo)CoverageInfo).ExportAsync().ConfigureAwait(false) : null,
                                   ProductInfo = ProductInfo != null?await((ProductInfo)ProductInfo).ExportAsync().ConfigureAwait(false) : null,
                                                     ReplacedBy = ReplacedBy?.ToString(),
                                                     References = References?.References?.ToDictionary(r => r.Key, r => r.Value),
                                                     NextLiveTime = NextLiveTime,
                                                     StartTimeConfirmed = StartTimeConfirmed,
                                                     ScheduledStartTimeChanges = scheduledTasks != null ? await Task.WhenAll(scheduledTasks) : null,
                                                     StartTime = StartTime,
                                                     TvChannels = channelTasks != null ? await Task.WhenAll(channelTasks) : null,
                                                     StartTimeTBD = StartTimeTBD
            });
        }