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

            if (exportable is ExportableCompetitionCI competition)
            {
                competition.BookingStatus = _bookingStatus;
                competition.Venue         = _venue != null ? await _venue.ExportAsync() : null;

                competition.Conditions = _conditions != null ? await _conditions.ExportAsync() : null;

                competition.Competitors           = Competitors?.Select(c => c.ToString()).ToList();
                competition.ReferenceId           = _referenceId?.ReferenceIds?.ToDictionary(r => r.Key, r => r.Value);
                competition.CompetitorsQualifiers =
                    _competitorsQualifiers?.ToDictionary(q => q.Key.ToString(), q => q.Value);
                competition.CompetitorsReferences = _competitorsReferences?.ToDictionary(r => r.Key.ToString(),
                                                                                         r => (IDictionary <string, string>)r.Value.ReferenceIds.ToDictionary(v => v.Key, v => v.Value));
                competition.CompetitorsVirtual = _competitorsVirtual.IsNullOrEmpty() ? null : _competitorsVirtual.Select(s => s.ToString()).ToList();
                competition.LiveOdds           = _liveOdds;
                competition.SportEventType     = _sportEventType;
                competition.StageType          = _stageType;
            }

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

            var competition = exportable as ExportableCompetitionCI;

            competition.BookingStatus = _bookingStatus;
            competition.Venue         = _venue != null ? await _venue.ExportAsync() : null;

            competition.Conditions = _conditions != null ? await _conditions.ExportAsync() : null;

            competition.Competitors           = Competitors?.Select(c => c.ToString()).ToList();
            competition.ReferenceId           = _referenceId?.ReferenceIds?.ToDictionary(r => r.Key, r => r.Value);
            competition.CompetitorsQualifiers = _competitorsQualifiers?.ToDictionary(q => q.Key.ToString(), q => q.Value);
            competition.CompetitorsReferences = _competitorsReferences?.ToDictionary(r => r.Key.ToString(), r => (IDictionary <string, string>)r.Value.ReferenceIds.ToDictionary(v => v.Key, v => v.Value));

            return(exportable);
        }