/// <summary> /// Initializes a new instance of the <see cref="TournamentInfoCI"/> class /// </summary> /// <param name="fixture">The fixture data</param> /// <param name="dataRouterManager">The <see cref="IDataRouterManager"/> used to obtain summary and fixture</param> /// <param name="semaphorePool">A <see cref="ISemaphorePool" /> instance used to obtain sync objects</param> /// <param name="currentCulture">A <see cref="CultureInfo" /> of the <see cref="SportEventSummaryDTO" /> instance</param> /// <param name="defaultCulture">A <see cref="CultureInfo" /> specifying the language used when fetching info which is not translatable (e.g. Scheduled, ..)</param> /// <param name="fixtureTimestampCache">A <see cref="ObjectCache"/> used to cache the sport events fixture timestamps</param> public TournamentInfoCI(FixtureDTO fixture, IDataRouterManager dataRouterManager, ISemaphorePool semaphorePool, CultureInfo currentCulture, CultureInfo defaultCulture, ObjectCache fixtureTimestampCache) : base(fixture, dataRouterManager, semaphorePool, currentCulture, defaultCulture, fixtureTimestampCache) { Merge(fixture, currentCulture, true); }
/// <summary> /// Initializes a new instance of the <see cref="LotteryCI"/> class /// </summary> /// <param name="id">A <see cref="URN" /> specifying the id of the sport event associated with the current instance</param> /// <param name="dataRouterManager">The <see cref="IDataRouterManager"/> used to obtain summary and fixture</param> /// <param name="semaphorePool">A <see cref="ISemaphorePool" /> instance used to obtain sync objects</param> /// <param name="defaultCulture">A <see cref="CultureInfo" /> specifying the language used when fetching info which is not translatable (e.g. Scheduled, ..)</param> /// <param name="fixtureTimestampCache">A <see cref="MemoryCache"/> used to cache the sport events fixture timestamps</param> public LotteryCI(URN id, IDataRouterManager dataRouterManager, ISemaphorePool semaphorePool, CultureInfo defaultCulture, MemoryCache fixtureTimestampCache) : base(id, dataRouterManager, semaphorePool, defaultCulture, fixtureTimestampCache) { _scheduleFetched = false; _dataRouterManager = dataRouterManager; }
/// <summary> /// Initializes a new instance of the <see cref="StageCI"/> class /// </summary> /// <param name="eventSummary">The event summary</param> /// <param name="dataRouterManager">The <see cref="IDataRouterManager"/> used to obtain summary and fixture</param> /// <param name="semaphorePool">The semaphore pool</param> /// <param name="currentCulture">The current culture</param> /// <param name="defaultCulture">The default culture</param> /// <param name="fixtureTimestampCache">A <see cref="ObjectCache"/> used to cache the sport events fixture timestamps</param> public StageCI(StageDTO eventSummary, IDataRouterManager dataRouterManager, ISemaphorePool semaphorePool, CultureInfo currentCulture, CultureInfo defaultCulture, ObjectCache fixtureTimestampCache) : base(eventSummary, dataRouterManager, semaphorePool, currentCulture, defaultCulture, fixtureTimestampCache) { Merge(eventSummary, currentCulture, true); }
/// <summary> /// Initializes a new instance of the <see cref="TournamentInfoBasicCI"/> class /// </summary> /// <param name="exportable">The exportable</param> /// <param name="dataRouterManager">The <see cref="IDataRouterManager"/> used to fetch missing data</param> public TournamentInfoBasicCI(ExportableTournamentInfoBasicCI exportable, IDataRouterManager dataRouterManager) : base(exportable) { _dataRouterManager = dataRouterManager; Category = exportable.Category != null?URN.Parse(exportable.Category) : null; CurrentSeason = exportable.CurrentSeason != null ? new CurrentSeasonInfoCI(exportable.CurrentSeason, dataRouterManager) : null; }
/// <summary> /// Initializes a new instance of the <see cref="MatchCI" /> class /// </summary> /// <param name="eventSummary">The event summary</param> /// <param name="dataRouterManager">The <see cref="IDataRouterManager" /> used to obtain summary and fixture</param> /// <param name="semaphorePool">The semaphore pool</param> /// <param name="currentCulture">The current culture</param> /// <param name="defaultCulture">The default culture</param> /// <param name="fixtureTimestampCache">A <see cref="MemoryCache" /> used to cache the sport events fixture timestamps</param> public MatchCI(MatchDTO eventSummary, IDataRouterManager dataRouterManager, ISemaphorePool semaphorePool, CultureInfo currentCulture, CultureInfo defaultCulture, MemoryCache fixtureTimestampCache) : base(eventSummary, dataRouterManager, semaphorePool, currentCulture, defaultCulture, fixtureTimestampCache) { Merge(eventSummary, currentCulture, true); }
/// <summary> /// Initializes a new instance of the <see cref="StageCI" /> class /// </summary> /// <param name="tournamentSummary">The tournament summary</param> /// <param name="dataRouterManager">The <see cref="IDataRouterManager" /> used to obtain summary and fixture</param> /// <param name="semaphorePool">The semaphore pool</param> /// <param name="currentCulture">The current culture</param> /// <param name="defaultCulture">The default culture</param> /// <param name="fixtureTimestampCache">A <see cref="MemoryCache" /> used to cache the sport events fixture timestamps</param> public StageCI(TournamentInfoDTO tournamentSummary, IDataRouterManager dataRouterManager, ISemaphorePool semaphorePool, CultureInfo currentCulture, CultureInfo defaultCulture, MemoryCache fixtureTimestampCache) : base(tournamentSummary, dataRouterManager, semaphorePool, currentCulture, defaultCulture, fixtureTimestampCache) { Merge(tournamentSummary, currentCulture, true); }
/// <summary> /// Initializes a new instance of the <see cref="GroupCI"/> class. /// </summary> /// <param name="group">A <see cref="GroupDTO"/> containing group information</param> /// <param name="culture">A <see cref="CultureInfo"/> specifying the language of the provided group information</param> /// <param name="dataRouterManager">The <see cref="IDataRouterManager"/> used to fetch missing data</param> internal GroupCI(GroupDTO group, CultureInfo culture, IDataRouterManager dataRouterManager) { Contract.Requires(group != null); Contract.Requires(culture != null); _dataRouterManager = dataRouterManager; Name = group.Name; Competitors = group.Competitors != null ? new ReadOnlyCollection <CompetitorCI>(group.Competitors.Select(c => new CompetitorCI(c, culture, _dataRouterManager)).ToList()) : null; }
/// <summary> /// Initializes a new instance of the <see cref="SportEventCacheItemFactory"/> class. /// </summary> /// <param name="dataRouterManager">The <see cref="IDataRouterManager"/> used to obtain summary and fixture</param> /// <param name="semaphorePool">A <see cref="ISemaphorePool"/> instance to be used by instances constructed by this factory</param> /// <param name="defaultCulture">A <see cref="CultureInfo"/> specifying the default culture of the built cache items</param> /// <param name="fixtureTimestampCache">The in-memory cache of sport events fixture timestamps</param> public SportEventCacheItemFactory(IDataRouterManager dataRouterManager, ISemaphorePool semaphorePool, CultureInfo defaultCulture, MemoryCache fixtureTimestampCache) { Guard.Argument(dataRouterManager, nameof(dataRouterManager)).NotNull(); Guard.Argument(semaphorePool, nameof(semaphorePool)).NotNull(); Guard.Argument(defaultCulture, nameof(defaultCulture)).NotNull(); Guard.Argument(fixtureTimestampCache, nameof(fixtureTimestampCache)).NotNull(); _dataRouterManager = dataRouterManager; _semaphorePool = semaphorePool; _defaultCulture = defaultCulture; _fixtureTimestampCache = fixtureTimestampCache; }
/// <summary> /// Initializes a new instance of the <see cref="StageCI"/> class /// </summary> /// <param name="exportable">The exportable cache item</param> /// <param name="dataRouterManager">The <see cref="IDataRouterManager"/> used to obtain summary and fixtureDTO</param> /// <param name="semaphorePool">The semaphore pool</param> /// <param name="defaultCulture">The default culture</param> /// <param name="fixtureTimestampCache">A <see cref="MemoryCache"/> used to cache the sport events fixtureDTO timestamps</param> public StageCI(ExportableStageCI exportable, IDataRouterManager dataRouterManager, ISemaphorePool semaphorePool, CultureInfo defaultCulture, MemoryCache fixtureTimestampCache) : base(exportable, dataRouterManager, semaphorePool, defaultCulture, fixtureTimestampCache) { _categoryId = string.IsNullOrEmpty(exportable.CategoryId) ? null : URN.Parse(exportable.CategoryId); _parentStageId = string.IsNullOrEmpty(exportable.ParentStageId) ? null : URN.Parse(exportable.ParentStageId); _childStages = exportable.ChildStages?.Select(s => new StageCI(s, dataRouterManager, semaphorePool, defaultCulture, fixtureTimestampCache)); _additionalParentIds = exportable.AdditionalParentIds.IsNullOrEmpty() ? null : exportable.AdditionalParentIds.Select(URN.Parse).ToList(); }
/// <summary> /// Initializes a new instance of the <see cref="StageCI"/> class /// </summary> /// <param name="exportable">The exportable cache item</param> /// <param name="dataRouterManager">The <see cref="IDataRouterManager"/> used to obtain summary and fixture</param> /// <param name="semaphorePool">The semaphore pool</param> /// <param name="defaultCulture">The default culture</param> /// <param name="fixtureTimestampCache">A <see cref="ObjectCache"/> used to cache the sport events fixture timestamps</param> public StageCI(ExportableStageCI exportable, IDataRouterManager dataRouterManager, ISemaphorePool semaphorePool, CultureInfo defaultCulture, ObjectCache fixtureTimestampCache) : base(exportable, dataRouterManager, semaphorePool, defaultCulture, fixtureTimestampCache) { _categoryId = URN.Parse(exportable.CategoryId); _parentStage = exportable.ParentStage != null ? new StageCI(exportable.ParentStage, dataRouterManager, semaphorePool, defaultCulture, fixtureTimestampCache) : null; _childStages = exportable.ChildStages?.Select(s => new StageCI(s, dataRouterManager, semaphorePool, defaultCulture, fixtureTimestampCache)); _stageType = exportable.StageType; }
/// <summary> /// Initializes a new instance of the <see cref="ProfileCache" /> class /// </summary> /// <param name="cache">A <see cref="MemoryCache" /> used to store fetched information</param> /// <param name="dataRouterManager">A <see cref="IDataRouterManager" /> used to fetch data</param> /// <param name="cacheManager">A <see cref="ICacheManager" /> used to interact among caches</param> public ProfileCache(MemoryCache cache, IDataRouterManager dataRouterManager, ICacheManager cacheManager) : base(cacheManager) { Contract.Requires(cache != null); Contract.Requires(dataRouterManager != null); _cache = cache; _dataRouterManager = dataRouterManager; _isDisposed = false; }
/// <summary> /// Initializes a new instance of the <see cref="SportEventCacheItemFactory"/> class. /// </summary> /// <param name="dataRouterManager">The <see cref="IDataRouterManager"/> used to obtain summary and fixture</param> /// <param name="semaphorePool">A <see cref="ISemaphorePool"/> instance to be used by instances constructed by this factory</param> /// <param name="defaultCulture">A <see cref="CultureInfo"/> specifying the default culture of the built cache items</param> /// <param name="fixtureTimestampCache">The in-memory cache of sport events fixture timestamps</param> public SportEventCacheItemFactory(IDataRouterManager dataRouterManager, ISemaphorePool semaphorePool, CultureInfo defaultCulture, ObjectCache fixtureTimestampCache) { Contract.Requires(dataRouterManager != null); Contract.Requires(semaphorePool != null); Contract.Requires(defaultCulture != null); Contract.Requires(fixtureTimestampCache != null); _dataRouterManager = dataRouterManager; _semaphorePool = semaphorePool; _defaultCulture = defaultCulture; _fixtureTimestampCache = fixtureTimestampCache; }
/// <summary> /// Initializes a new instance of the <see cref="GroupCI"/> class /// </summary> /// <param name="group">A <see cref="GroupDTO"/> containing group information</param> /// <param name="culture">A <see cref="CultureInfo"/> specifying the language of the provided group information</param> /// <param name="dataRouterManager">The <see cref="IDataRouterManager"/> used to fetch missing data</param> internal GroupCI(GroupDTO group, CultureInfo culture, IDataRouterManager dataRouterManager) { Guard.Argument(group, nameof(group)).NotNull(); Guard.Argument(culture, nameof(culture)).NotNull(); _dataRouterManager = dataRouterManager; Id = group.Id; Name = group.Name; Competitors = group.Competitors != null ? new ReadOnlyCollection <CompetitorCI>(group.Competitors.Select(c => new CompetitorCI(c, culture, _dataRouterManager)).ToList()) : null; }
/// <summary> /// Initializes a new instance of the <see cref="GroupCI"/> class /// </summary> /// <param name="exportable">A <see cref="ExportableGroupCI"/> containing group information</param> /// <param name="dataRouterManager">The <see cref="IDataRouterManager"/> used to fetch missing data</param> internal GroupCI(ExportableGroupCI exportable, IDataRouterManager dataRouterManager) { if (exportable == null) { throw new ArgumentNullException(nameof(exportable)); } _dataRouterManager = dataRouterManager; Id = exportable.Id; Name = exportable.Name; Competitors = exportable.Competitors?.Select(c => new CompetitorCI(c, dataRouterManager)).ToList(); }
/// <summary> /// Initializes a new instance of the <see cref="LotteryCI"/> class /// </summary> /// <param name="exportable">A <see cref="ExportableLotteryCI" /> specifying the current instance</param> /// <param name="dataRouterManager">The <see cref="IDataRouterManager"/> used to obtain summary and fixture</param> /// <param name="semaphorePool">A <see cref="ISemaphorePool" /> instance used to obtain sync objects</param> /// <param name="defaultCulture">A <see cref="CultureInfo" /> specifying the language used when fetching info which is not translatable (e.g. Scheduled, ..)</param> /// <param name="fixtureTimestampCache">A <see cref="MemoryCache"/> used to cache the sport events fixture timestamps</param> public LotteryCI(ExportableLotteryCI exportable, IDataRouterManager dataRouterManager, ISemaphorePool semaphorePool, CultureInfo defaultCulture, MemoryCache fixtureTimestampCache) : base(exportable, dataRouterManager, semaphorePool, defaultCulture, fixtureTimestampCache) { _categoryId = URN.Parse(exportable.CategoryId); _bonusInfo = exportable.BonusInfo != null ? new BonusInfoCI(exportable.BonusInfo) : null; _drawInfo = exportable.DrawInfo != null ? new DrawInfoCI(exportable.DrawInfo) : null; _scheduledDraws = exportable.ScheduledDraws?.Select(URN.Parse).ToList(); }
/// <summary> /// Initializes a new instance of the <see cref="StageCI"/> class /// </summary> /// <param name="exportable">The exportable cache item</param> /// <param name="dataRouterManager">The <see cref="IDataRouterManager"/> used to obtain summary and fixtureDTO</param> /// <param name="semaphorePool">The semaphore pool</param> /// <param name="defaultCulture">The default culture</param> /// <param name="fixtureTimestampCache">A <see cref="MemoryCache"/> used to cache the sport events fixtureDTO timestamps</param> public StageCI(ExportableStageCI exportable, IDataRouterManager dataRouterManager, ISemaphorePool semaphorePool, CultureInfo defaultCulture, MemoryCache fixtureTimestampCache) : base(exportable, dataRouterManager, semaphorePool, defaultCulture, fixtureTimestampCache) { _categoryId = URN.Parse(exportable.CategoryId); _parentStageId = exportable.ParentStageId; _childStages = exportable.ChildStages?.Select(s => new StageCI(s, dataRouterManager, semaphorePool, defaultCulture, fixtureTimestampCache)); _additionalParentIds = exportable.AdditionalParentIds; }
/// <summary> /// Initializes a new instance of the <see cref="ProfileCache"/> class /// </summary> /// <param name="cache">A <see cref="MemoryCache"/> used to store fetched information</param> /// <param name="dataRouterManager">A <see cref="IDataRouterManager"/> used to fetch data</param> /// <param name="cacheManager">A <see cref="ICacheManager"/> used to interact among caches</param> public ProfileCache(MemoryCache cache, IDataRouterManager dataRouterManager, ICacheManager cacheManager) : base(cacheManager, null) { Guard.Argument(cache, nameof(cache)).NotNull(); Guard.Argument(dataRouterManager, nameof(dataRouterManager)).NotNull(); _cache = cache; _dataRouterManager = dataRouterManager; _isDisposed = false; }
/// <summary> /// Initializes a new instance of the <see cref="CompetitionCI"/> class /// </summary> /// <param name="eventSummary">The event summary</param> /// <param name="dataRouterManager">The <see cref="IDataRouterManager"/> used to obtain summary and fixtureDTO</param> /// <param name="semaphorePool">The semaphore pool</param> /// <param name="currentCulture">The current culture</param> /// <param name="defaultCulture">The default culture</param> /// <param name="fixtureTimestampCache">A <see cref="MemoryCache"/> used to cache the sport events fixtureDTO timestamps</param> public CompetitionCI(CompetitionDTO eventSummary, IDataRouterManager dataRouterManager, ISemaphorePool semaphorePool, CultureInfo currentCulture, CultureInfo defaultCulture, MemoryCache fixtureTimestampCache) : base(eventSummary, dataRouterManager, semaphorePool, currentCulture, defaultCulture, fixtureTimestampCache) { Guard.Argument(eventSummary, nameof(eventSummary)).NotNull(); Guard.Argument(currentCulture, nameof(currentCulture)).NotNull(); Merge(eventSummary, currentCulture, true); }
/// <summary> /// Initializes a new instance of the <see cref="DrawCI"/> class /// </summary> /// <param name="exportable">A <see cref="ExportableDrawCI" /> specifying the current instance</param> /// <param name="dataRouterManager">The <see cref="IDataRouterManager"/> used to obtain summary and fixture</param> /// <param name="semaphorePool">A <see cref="ISemaphorePool" /> instance used to obtain sync objects</param> /// <param name="defaultCulture">A <see cref="CultureInfo" /> specifying the language used when fetching info which is not translatable (e.g. Scheduled, ..)</param> /// <param name="fixtureTimestampCache">A <see cref="MemoryCache"/> used to cache the sport events fixture timestamps</param> public DrawCI(ExportableDrawCI exportable, IDataRouterManager dataRouterManager, ISemaphorePool semaphorePool, CultureInfo defaultCulture, MemoryCache fixtureTimestampCache) : base(exportable, dataRouterManager, semaphorePool, defaultCulture, fixtureTimestampCache) { _lotteryId = URN.Parse(exportable.LotteryId); _drawStatus = exportable.DrawStatus; _resultsChronological = exportable.ResultsChronological; _results = exportable.Results?.Select(r => new DrawResultCI(r)).ToList(); _displayId = exportable.DisplayId; }
/// <summary> /// Initializes a new instance of the <see cref="CurrentSeasonInfoCI"/> class /// </summary> /// <param name="exportable">The exportable</param> /// <param name="dataRouterManager">The <see cref="IDataRouterManager"/> used to fetch missing data</param> public CurrentSeasonInfoCI(ExportableCurrentSeasonInfoCI exportable, IDataRouterManager dataRouterManager) : base(exportable) { _dataRouterManager = dataRouterManager; Year = exportable.Year; StartDate = exportable.StartDate; EndDate = exportable.EndDate; SeasonCoverage = exportable.SeasonCoverage == null ? null : new SeasonCoverageCI(exportable.SeasonCoverage); Groups = exportable.Groups?.Select(g => new GroupCI(g, dataRouterManager)).ToList(); CurrentRound = exportable.CurrentRound == null ? null : new RoundCI(exportable.CurrentRound); Competitors = exportable.Competitors?.Select(c => new CompetitorCI(c, dataRouterManager)).ToList(); Schedule = exportable.Schedule?.Select(URN.Parse).ToList(); }
/// <summary> /// Initializes a new instance of the <see cref="GroupCI"/> class /// </summary> /// <param name="exportable">A <see cref="ExportableGroupCI"/> containing group information</param> /// <param name="dataRouterManager">The <see cref="IDataRouterManager"/> used to fetch missing data</param> internal GroupCI(ExportableGroupCI exportable, IDataRouterManager dataRouterManager) { if (exportable == null) { throw new ArgumentNullException(nameof(exportable)); } _dataRouterManager = dataRouterManager; Id = exportable.Id; Name = exportable.Name; Competitors = exportable.Competitors?.Select(c => new CompetitorCI(c, dataRouterManager)).ToList(); CompetitorsReferences = exportable.CompetitorsReferences?.ToDictionary(c => URN.Parse(c.Key), c => new ReferenceIdCI(c.Value)); }
/// <summary> /// Initializes a new instance of the <see cref="SportEventCI" /> class /// </summary> /// <param name="eventSummary">The sport event summary</param> /// <param name="dataRouterManager">The <see cref="IDataRouterManager"/> used to obtain summary and fixture</param> /// <param name="semaphorePool">A <see cref="ISemaphorePool" /> instance used to obtain sync objects</param> /// <param name="currentCulture">A <see cref="CultureInfo" /> of the <see cref="SportEventSummaryDTO" /> instance</param> /// <param name="defaultCulture">A <see cref="CultureInfo" /> specifying the language used when fetching info which is not translatable (e.g. Scheduled, ..)</param> /// <param name="fixtureTimestampCache">A <see cref="MemoryCache"/> used to cache the sport events fixture timestamps</param> public SportEventCI(SportEventSummaryDTO eventSummary, IDataRouterManager dataRouterManager, ISemaphorePool semaphorePool, CultureInfo currentCulture, CultureInfo defaultCulture, MemoryCache fixtureTimestampCache) : this(eventSummary.Id, dataRouterManager, semaphorePool, defaultCulture, fixtureTimestampCache) { Guard.Argument(eventSummary, nameof(eventSummary)).NotNull(); Guard.Argument(currentCulture, nameof(currentCulture)).NotNull(); Merge(eventSummary, currentCulture); }
/// <summary> /// Initializes a new instance of the <see cref="SportEventCI" /> class /// </summary> /// <param name="eventSummary">The sport event summary</param> /// <param name="dataRouterManager">The <see cref="IDataRouterManager" /> used to obtain summary and fixture</param> /// <param name="semaphorePool">A <see cref="ISemaphorePool" /> instance used to obtain sync objects</param> /// <param name="currentCulture">A <see cref="CultureInfo" /> of the <see cref="SportEventSummaryDTO" /> instance</param> /// <param name="defaultCulture"> /// A <see cref="CultureInfo" /> specifying the language used when fetching info which is not /// translatable (e.g. Scheduled, ..) /// </param> /// <param name="fixtureTimestampCache">A <see cref="MemoryCache" /> used to cache the sport events fixture timestamps</param> public SportEventCI(SportEventSummaryDTO eventSummary, IDataRouterManager dataRouterManager, ISemaphorePool semaphorePool, CultureInfo currentCulture, CultureInfo defaultCulture, MemoryCache fixtureTimestampCache) : this(eventSummary.Id, dataRouterManager, semaphorePool, defaultCulture, fixtureTimestampCache) { Contract.Requires(eventSummary != null); Contract.Requires(currentCulture != null); Merge(eventSummary, currentCulture); }
/// <summary> /// Initializes a new instance of the <see cref="CompetitionCI"/> class /// </summary> /// <param name="eventSummary">The event summary</param> /// <param name="dataRouterManager">The <see cref="IDataRouterManager"/> used to obtain summary and fixture</param> /// <param name="semaphorePool">The semaphore pool</param> /// <param name="currentCulture">The current culture</param> /// <param name="defaultCulture">The default culture</param> /// <param name="fixtureTimestampCache">A <see cref="ObjectCache"/> used to cache the sport events fixture timestamps</param> public CompetitionCI(CompetitionDTO eventSummary, IDataRouterManager dataRouterManager, ISemaphorePool semaphorePool, CultureInfo currentCulture, CultureInfo defaultCulture, ObjectCache fixtureTimestampCache) : base(eventSummary, dataRouterManager, semaphorePool, currentCulture, defaultCulture, fixtureTimestampCache) { Contract.Requires(eventSummary != null); Contract.Requires(currentCulture != null); Merge(eventSummary, currentCulture, true); }
/// <summary> /// Initializes a new instance of the <see cref="LotteryCI"/> class /// </summary> /// <param name="eventSummary">The event summary</param> /// <param name="dataRouterManager">The <see cref="IDataRouterManager"/> used to obtain summary and fixture</param> /// <param name="semaphorePool">The semaphore pool</param> /// <param name="currentCulture">The current culture</param> /// <param name="defaultCulture">The default culture</param> /// <param name="fixtureTimestampCache">A <see cref="ObjectCache"/> used to cache the sport events fixture timestamps</param> public LotteryCI(LotteryDTO eventSummary, IDataRouterManager dataRouterManager, ISemaphorePool semaphorePool, CultureInfo currentCulture, CultureInfo defaultCulture, ObjectCache fixtureTimestampCache) : base(eventSummary, dataRouterManager, semaphorePool, currentCulture, defaultCulture, fixtureTimestampCache) { Guard.Argument(eventSummary, nameof(eventSummary)).NotNull(); Guard.Argument(currentCulture, nameof(currentCulture)).NotNull(); Merge(eventSummary, currentCulture); }
/// <summary> /// Initializes a new instance of the <see cref="VariantMarketDescriptionCache"/> class /// </summary> /// <param name="cache">A <see cref="MemoryCache"/> used to store market descriptors</param> /// <param name="dataRouterManager">A <see cref="IDataRouterManager"/> used to fetch data</param> /// <param name="mappingValidatorFactory">A <see cref="IMappingValidatorFactory"/> used to construct <see cref="IMappingValidator"/> instances for market mappings</param> /// <param name="cacheManager">A <see cref="ICacheManager"/> used to interact among caches</param> public VariantMarketDescriptionCache(MemoryCache cache, IDataRouterManager dataRouterManager, IMappingValidatorFactory mappingValidatorFactory, ICacheManager cacheManager) : base(cacheManager) { Guard.Argument(cache, nameof(cache)).NotNull(); Guard.Argument(dataRouterManager, nameof(dataRouterManager)).NotNull(); Guard.Argument(mappingValidatorFactory, nameof(mappingValidatorFactory)).NotNull(); _cache = cache; _dataRouterManager = dataRouterManager; _mappingValidatorFactory = mappingValidatorFactory; }
/// <summary> /// Initializes a new instance of the <see cref="CustomBetManager"/> class /// </summary> /// <param name="dataRouterManager">A <see cref="IDataRouterManager"/> used to make custom bet API requests</param> /// <param name="customBetSelectionBuilder">A <see cref="ICustomBetSelectionBuilder"/> used to build selections</param> public CustomBetManager(IDataRouterManager dataRouterManager, ICustomBetSelectionBuilder customBetSelectionBuilder) { if (dataRouterManager == null) { throw new ArgumentNullException(nameof(dataRouterManager)); } if (customBetSelectionBuilder == null) { throw new ArgumentNullException(nameof(customBetSelectionBuilder)); } _dataRouterManager = dataRouterManager; CustomBetSelectionBuilder = customBetSelectionBuilder; }
/// <summary> /// Initializes a new instance of the <see cref="VariantMarketDescriptionCache"/> class /// </summary> /// <param name="cache">A <see cref="ObjectCache"/> used to store market descriptors</param> /// <param name="dataRouterManager">A <see cref="IDataRouterManager"/> used to fetch data</param> /// <param name="mappingValidatorFactory">A <see cref="IMappingValidatorFactory"/> used to construct <see cref="IMappingValidator"/> instances for market mappings</param> /// <param name="cacheManager">A <see cref="ICacheManager"/> used to interact among caches</param> public VariantMarketDescriptionCache(ObjectCache cache, IDataRouterManager dataRouterManager, IMappingValidatorFactory mappingValidatorFactory, ICacheManager cacheManager) : base(cacheManager) { Contract.Requires(cache != null); Contract.Requires(dataRouterManager != null); Contract.Requires(mappingValidatorFactory != null); _cache = cache; _dataRouterManager = dataRouterManager; _mappingValidatorFactory = mappingValidatorFactory; }
/// <summary> /// Initializes a new instance of the <see cref="MatchCI"/> class /// </summary> /// <param name="exportable">A <see cref="ExportableMatchCI" /> specifying the current instance</param> /// <param name="dataRouterManager">The <see cref="IDataRouterManager"/> used to obtain summary and fixture</param> /// <param name="semaphorePool">A <see cref="ISemaphorePool" /> instance used to obtain sync objects</param> /// <param name="defaultCulture">A <see cref="CultureInfo" /> specifying the language used when fetching info which is not translatable (e.g. Scheduled, ..)</param> /// <param name="fixtureTimestampCache">A <see cref="MemoryCache"/> used to cache the sport events fixture timestamps</param> public MatchCI(ExportableMatchCI exportable, IDataRouterManager dataRouterManager, ISemaphorePool semaphorePool, CultureInfo defaultCulture, MemoryCache fixtureTimestampCache) : base(exportable, dataRouterManager, semaphorePool, defaultCulture, fixtureTimestampCache) { _season = exportable.Season != null ? new CacheItem(exportable.Season) : null; _tournamentRound = exportable.TournamentRound != null ? new RoundCI(exportable.TournamentRound) : null; _tournamentId = exportable.TournamentId != null ? URN.Parse(exportable.TournamentId) : null; _fixture = exportable.Fixture != null ? new Fixture(exportable.Fixture) : null; _eventTimeline = exportable.EventTimeline != null ? new EventTimelineCI(exportable.EventTimeline) : null; _delayedInfo = exportable.DelayedInfo != null ? new DelayedInfoCI(exportable.DelayedInfo) : null; }
/// <summary> /// Initializes a new instance of the <see cref="TournamentInfoBasicCI"/> class /// </summary> /// <param name="dto">The dto</param> /// <param name="culture">The culture</param> /// <param name="dataRouterManager">The <see cref="IDataRouterManager"/> used to fetch missing data</param> public TournamentInfoBasicCI(TournamentInfoDTO dto, CultureInfo culture, IDataRouterManager dataRouterManager) : base(dto.Id, dto.Name, culture) { Guard.Argument(dto, nameof(dto)).NotNull(); _dataRouterManager = dataRouterManager; if (dto.Category != null) { Category = dto.Category.Id; } if (dto.CurrentSeason != null) { CurrentSeason = new CurrentSeasonInfoCI(dto.CurrentSeason, culture, _dataRouterManager); } }