private static List <TeamLeagueMatch> CreateMatches(TeamLeagueRound round, List <Domain.Competitor.TeamCompetitor> competitors) { var matchEntries = new List <TeamMatchEntry>(); var matchEntry = new TeamMatchEntry { HomeAway = HomeAway.Home, Team = competitors[0].Team, }; matchEntry.Lineup = CreateLineup(matchEntry, 0); matchEntries.Add(matchEntry); matchEntry = new TeamMatchEntry { HomeAway = HomeAway.Away, Team = competitors[1].Team, }; matchEntry.Lineup = CreateLineup(matchEntry, 11); matchEntries.Add(matchEntry); var match = new TeamLeagueMatch { Guid = new Guid("00000000-0000-0000-0000-000000000000"), TeamLeagueRound = round, MatchEntries = matchEntries }; match.MatchEntries.ToList().ForEach(me => me.TeamLeagueMatch = match); return(new List <TeamLeagueMatch> { match }); }
private static List <TeamMatchEntryLineupEntry> CreateLineup(TeamMatchEntry matchEntry, int totalCounter) { var list = new List <TeamMatchEntryLineupEntry>(); for (int i = 0; i < 11; i++) { int counter = totalCounter + i; string guidValue = "00000000-0000-0000-0000-000000000000"; guidValue = guidValue.Substring(0, guidValue.Length - 1 - (counter.ToString().Length - 1)) + counter.ToString(); list.Add(new TeamMatchEntryLineupEntry { Guid = new Guid(guidValue), Player = new Domain.Player.Player(), Number = (i + 1).ToString(), TeamMatchEntry = matchEntry, }); } return(list); }