Example #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="BonusInfo"/> class.
        /// </summary>
        /// <param name="item">The item.</param>
        public BonusInfo(BonusInfoCI item)
        {
            Guard.Argument(item, nameof(item)).NotNull();

            BonusBalls    = item.BonusBalls;
            BonusDrumType = item.BonusDrumType;
            BonusRange    = item.BonusRange;
        }
Example #2
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="BonusInfo" /> class.
        /// </summary>
        /// <param name="item">The item.</param>
        public BonusInfo(BonusInfoCI item)
        {
            Contract.Requires(item != null);

            BonusBalls    = item.BonusBalls;
            BonusDrumType = item.BonusDrumType;
            BonusRange    = item.BonusRange;
        }
 /// <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();
 }
Example #4
0
        /// <summary>
        /// Merges the specified event summary
        /// </summary>
        /// <param name="eventSummary">The event summary</param>
        /// <param name="culture">The culture</param>
        private void Merge(LotteryDTO eventSummary, CultureInfo culture)
        {
            base.Merge(eventSummary, culture, false);

            if (_categoryId == null && eventSummary.Category != null)
            {
                _categoryId = eventSummary.Category.Id;
            }
            if (_bonusInfo == null && eventSummary.BonusInfo != null)
            {
                _bonusInfo = new BonusInfoCI(eventSummary.BonusInfo);
            }
            if (_drawInfo == null && eventSummary.DrawInfo != null)
            {
                _drawInfo = new DrawInfoCI(eventSummary.DrawInfo);
            }
            if (eventSummary.DrawEvents != null && eventSummary.DrawEvents.Any())
            {
                _scheduledDraws = eventSummary.DrawEvents.Select(s => s.Id);
            }
        }