我需要对一些足球排名进行排序.我的问题是如何按正确的顺序排序.
排序:
输入:TeamName - Points - GoalsScored - GoalsAgainst
......第4场比赛 - 第5队 - 第2队 - 1-2
第7场比赛 - 第1队 - 第3队--3-3 ......
输出:TeamName - Points - GoalsScored - GoalsAgainst
因为第2队战胜了第5队,他们最终获得了第2名.
因为第1队对阵第3队,所以他们最终在4位,目标差异更大.
public class Standing
{
public Team Team { get; set; }
public int? MatchesPlayed { get; set; }
public int? GoalsScored { get; set; }
public int? GoalsAgainst { get; set; }
public int? Points { get; set; }
}
public class Match
{
public int MatchID { get; set; }
public DateTime? PlayTime { get; set; }
public Team HomeTeam { get; set; }
public Team AwayTeam { get; set; }
public int? HomeScore { get; set; }
public int? AwayScore { get; set; }
}
public class Pool
{
public int PoolID { get; set; }
public string PoolName { get; set; }
public DateTime? StartTime { get; set; }
public List<Team> Teams { get; set; }
public List<Match> Matches { get; set; }
public List<Standing> Standings { get; set; }
}
Run Code Online (Sandbox Code Playgroud)