Esempio n. 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
                    ? 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;
        }
        protected override async Task <T> CreateExportableCIAsync <T>()
        {
            var exportable = await base.CreateExportableCIAsync <T>();

            var info = exportable as ExportableTournamentInfoCI;

            info.CategoryId         = _categoryId?.ToString();
            info.TournamentCoverage = _tournamentCoverage != null ? await _tournamentCoverage.ExportAsync().ConfigureAwait(false) : null;

            info.Competitors       = _competitors?.Select(s => s.ToString());
            info.CurrentSeasonInfo = _currentSeasonInfo != null ? await _currentSeasonInfo.ExportAsync().ConfigureAwait(false) : null;

            var groupsTasks = _groups?.Select(async g => await g.ExportAsync().ConfigureAwait(false));

            info.Groups = groupsTasks != null ? await Task.WhenAll(groupsTasks) : null;

            info.ScheduleUrns = _scheduleUrns?.Select(s => s.ToString()).ToList();
            info.Round        = _round != null ? await _round.ExportAsync().ConfigureAwait(false) : null;

            info.Year = _year;
            info.TournamentInfoBasic = _tournamentInfoBasic != null ? await _tournamentInfoBasic.ExportAsync().ConfigureAwait(false) : null;

            info.ReferenceId    = _referenceId?.ReferenceIds?.ToDictionary(r => r.Key, r => r.Value);
            info.SeasonCoverage = _seasonCoverage != null ? await _seasonCoverage.ExportAsync().ConfigureAwait(false) : null;

            info.Seasons               = _seasons?.Select(s => s.ToString()).ToList();
            info.LoadedSeasons         = new List <CultureInfo>(_loadedSeasons ?? new List <CultureInfo>());
            info.LoadedSchedules       = new List <CultureInfo>(_loadedSchedules ?? new List <CultureInfo>());
            info.CompetitorsReferences = _competitorsReferences?.ToDictionary(r => r.Key.ToString(), r => (IDictionary <string, string>)r.Value.ReferenceIds.ToDictionary(v => v.Key, v => v.Value));
            info.ExhibitionGames       = _exhibitionGames;

            return(exportable);
        }
Esempio n. 3
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);
        }
Esempio n. 4
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);
        }