コード例 #1
0
        // from feed
        public SportEventStatisticsDTO(statisticsType result)
        {
            Guard.Argument(result, nameof(result)).NotNull();

            var totalStatisticsDTOs = new List <TeamStatisticsDTO>();

            totalStatisticsDTOs.Add(new TeamStatisticsDTO(
                                        null,
                                        null,
                                        HomeAway.Home,
                                        result.yellow_cards?.home,
                                        result.red_cards?.home,
                                        result.yellow_red_cards?.home,
                                        result.corners?.home,
                                        result.green_cards?.home
                                        ));
            totalStatisticsDTOs.Add(new TeamStatisticsDTO(
                                        null,
                                        null,
                                        HomeAway.Away,
                                        result.yellow_cards?.away,
                                        result.red_cards?.away,
                                        result.yellow_red_cards?.away,
                                        result.corners?.away,
                                        result.green_cards?.away
                                        ));
            TotalStatisticsDTOs = totalStatisticsDTOs;

            PeriodStatisticsDTOs = null;
        }
コード例 #2
0
        public SportEventStatisticsDTO(statisticsType record)
        {
            Guard.Argument(record, nameof(record)).NotNull();

            var totalStatisticsDTOs = new List <TeamStatisticsDTO>();

            totalStatisticsDTOs.Add(new TeamStatisticsDTO(
                                        HomeAway.Home,
                                        record.yellow_cards.home,
                                        record.red_cards.home,
                                        record.yellow_red_cards.home,
                                        record.corners.home,
                                        record.green_cards == null ? 0 : record.green_cards.home
                                        ));
            totalStatisticsDTOs.Add(new TeamStatisticsDTO(
                                        HomeAway.Away,
                                        record.yellow_cards.away,
                                        record.red_cards.away,
                                        record.yellow_red_cards.away,
                                        record.corners.away,
                                        record.green_cards == null ? 0 : record.green_cards.away
                                        ));
            TotalStatisticsDTOs = totalStatisticsDTOs;

            PeriodStatisticsDTOs = null;
        }
コード例 #3
0
        public SportEventStatisticsDTO(statisticsType result)
        {
            Contract.Requires(result != null);

            var totalStatisticsDTOs = new List <TeamStatisticsDTO>();

            totalStatisticsDTOs.Add(new TeamStatisticsDTO(
                                        HomeAway.Home,
                                        result.yellow_cards.home,
                                        result.red_cards.home,
                                        result.yellow_red_cards.home,
                                        result.corners.home
                                        ));
            totalStatisticsDTOs.Add(new TeamStatisticsDTO(
                                        HomeAway.Away,
                                        result.yellow_cards.away,
                                        result.red_cards.away,
                                        result.yellow_red_cards.away,
                                        result.corners.away
                                        ));
            TotalStatisticsDTOs = totalStatisticsDTOs;

            PeriodStatisticsDTOs = null;
        }