Пример #1
0
        protected override async Task <T> CreateExportableCIAsync <T>()
        {
            var exportable = await base.CreateExportableCIAsync <T>();

            var match = exportable as ExportableMatchCI;

            if (match != null)
            {
                match.Season = _season != null
                    ? await _season.ExportAsync().ConfigureAwait(false)
                    : null;

                match.TournamentRound = _tournamentRound != null
                    ? await _tournamentRound.ExportAsync().ConfigureAwait(false)
                    : null;

                match.TournamentId = _tournamentId?.ToString();
                match.Fixture      = _fixture != null
                    ? await((Fixture)_fixture).ExportAsync().ConfigureAwait(false)
                    : null;

                match.EventTimeline = _eventTimeline != null
                    ? await _eventTimeline.ExportAsync().ConfigureAwait(false)
                    : null;

                match.DelayedInfo =
                    _delayedInfo != null ? await _delayedInfo.ExportAsync().ConfigureAwait(false) : null;
            }

            return(exportable);
        }
Пример #2
0
        protected override async Task<T> CreateExportableCIAsync<T>()
        {
            var exportable = await base.CreateExportableCIAsync<T>();
            var match = exportable as ExportableMatchCI;

            if (match != null)
            {
                match.Season = _season != null
                    ? new ExportableCI
                    {
                        Id = _season.Id.ToString(),
                        Name = new Dictionary<CultureInfo, string>(
                            _season.Name ?? new Dictionary<CultureInfo, string>())
                    }
                    : null;
                match.TournamentRound = _tournamentRound != null
                    ? await _tournamentRound.ExportAsync().ConfigureAwait(false)
                    : null;
                match.TournamentId = _tournamentId?.ToString();
                match.Fixture = _fixture != null
                    ? await ((Fixture) _fixture).ExportAsync().ConfigureAwait(false)
                    : null;
                match.EventTimeline = _eventTimeline != null
                    ? await _eventTimeline.ExportAsync().ConfigureAwait(false)
                    : null;
                match.DelayedInfo =
                    _delayedInfo != null ? await _delayedInfo.ExportAsync().ConfigureAwait(false) : null;
            }

            return exportable;
        }
Пример #3
0
        /// <inheritdoc />
        protected override async Task <T> CreateExportableCIAsync <T>()
        {
            var exportable = await base.CreateExportableCIAsync <T>();

            if (exportable is ExportableMatchCI match)
            {
                match.Season = _season != null
                    ? await _season.ExportAsync().ConfigureAwait(false)
                    : null;

                match.TournamentRound = _tournamentRound != null
                    ? await _tournamentRound.ExportAsync().ConfigureAwait(false)
                    : null;

                match.TournamentId = _tournamentId?.ToString();
                match.Fixture      = _fixture != null
                    ? await((Fixture)_fixture).ExportAsync().ConfigureAwait(false)
                    : null;

                match.EventTimeline = _eventTimeline != null
                    ? await _eventTimeline.ExportAsync().ConfigureAwait(false)
                    : null;

                match.DelayedInfo =
                    _delayedInfo != null ? await _delayedInfo.ExportAsync().ConfigureAwait(false) : null;

                match.CoverageInfo = _coverageInfo != null
                    ? new ExportableCoverageInfoCI
                {
                    CoveredFrom = _coverageInfo.CoveredFrom,
                    Includes    = _coverageInfo.Includes?.ToList(),
                    IsLive      = _coverageInfo.IsLive,
                    Level       = _coverageInfo.Level
                }
                    : null;
            }

            return(exportable);
        }