Example #1
0
        /// <summary>
        /// Transform the Lottery into reusable data
        /// </summary>
        /// <param name="lotteryDto"></param>
        private void CreateLottery(LotteryDto lotteryDto)
        {
            // First we need to create the Drawings
            var drawings = TransformDrawings(lotteryDto.Drawings);

            // Create the Lottery
            var lottery = new Lottery()
            {
                Name = lotteryDto.Name, HighestNumber = lotteryDto.HighestNumber, Drawings = drawings
            };

            // Run the statistics
            lottery.GenerateLotteryNumberStatistics();
            lottery.GenerateBonusBallStatistics();
            lottery.GeneratePatternLevelStatistics();

            // Then We need to populate the Lottery
            this.Lotteries.Add(lottery);
        }