当前位置: 首页>>代码示例>>C#>>正文


C# Series.AddSeriesFixture方法代码示例

本文整理汇总了C#中Series.AddSeriesFixture方法的典型用法代码示例。如果您正苦于以下问题:C# Series.AddSeriesFixture方法的具体用法?C# Series.AddSeriesFixture怎么用?C# Series.AddSeriesFixture使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Series的用法示例。


在下文中一共展示了Series.AddSeriesFixture方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreateSeries

        public static List<Series> CreateSeries(int id, Country country)
        {
            var series1 = CreateSeries(id, country, "A Lyga");
            var seriesFixture1 = CreateSeriesFixture(1000, 30, 1001, 1002, country);
            series1.AddSeriesFixture(seriesFixture1);

            var series2 = new Series { HtSeriesId = 1001, LeagueLevel = 2, LeagueLevelUnitName = "II.1", };
            series2.SetCountry(series1.Country);
            var seriesFixture2 = CreateSeriesFixture(1001, 30, 1003, 1004, country);

            series2.AddSeriesFixture(seriesFixture2);
            return new List<Series> { series1, series2 };
        }
开发者ID:erikaspl,项目名称:WhoScored,代码行数:13,代码来源:TestEntities.cs

示例2: SetFixtures

        private static void SetFixtures(Series series, int season, IEnumerable<SeriesFixturesSummaryEntity> seriesFixturesResult)
        {
            var teams = new List<Team>();
            var seriesFixture = series.SeriesFixtures;
            foreach (var match in seriesFixturesResult.First(s => s.LeagueLevelUnitID == series.HtSeriesId).Matches)
            {
                var fixture = seriesFixture.FirstOrDefault(f => f.HtMatchId == match.MatchID);
                if (fixture == null)
                {
                    fixture = new SeriesFixture();
                    var homeTeam = teams.FirstOrDefault(t => t.TeamId == match.HomeTeamID);
                    if (homeTeam == null)
                    {
                        homeTeam = new Team
                                       {
                                           Country = series.Country,
                                           TeamId = match.HomeTeamID,
                                           TeamName = match.HomeTeamName
                                       };
                        teams.Add(homeTeam);
                    }

                    var awayTeam = teams.FirstOrDefault(t => t.TeamId == match.AwayTeamID);
                    if (awayTeam == null)
                    {
                        awayTeam = new Team
                                       {
                                           Country = series.Country,
                                           TeamId = match.AwayTeamID,
                                           TeamName = match.AwayTeamName
                                       };
                        teams.Add(awayTeam);
                    }
                    fixture.HtMatchId = match.MatchID;
                    fixture.AwayTeam = awayTeam;
                    fixture.HomeTeam = homeTeam;
                    fixture.MatchDate = match.MatchDate;
                    fixture.MatchRound = match.MatchRound;
                    fixture.Season = (short)season;
                    series.AddSeriesFixture(fixture);
                }
                fixture.AwayGoals = (short?)match.AwayGoals;
                fixture.HomeGoals = (short?)match.HomeGoals;
            }
        }
开发者ID:erikaspl,项目名称:WhoScored,代码行数:45,代码来源:MigrateToNhibernateDomainService.cs


注:本文中的Series.AddSeriesFixture方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。