本文整理汇总了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 };
}
示例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;
}
}