示例#1
0
 public double WinningPercentage(string teamName)
 {
     return(GamesPlayed.Where(t =>
                              (t.AwayTeam == teamName && t.AwayScore > t.HomeScore)
                              ||
                              (t.HomeTeam == teamName && t.HomeScore > t.AwayScore))
            .Count() * 1.0
            /
            GamesPlayed.Where(t => t.AwayTeam == teamName || t.HomeTeam == teamName)
            .Count() * 1.0);
 }
示例#2
0
 public IEnumerable <Game> GamesPlayedByTeam(string teamName)
 {
     return(GamesPlayed.Where(g => g.AwayTeam == teamName || g.HomeTeam == teamName));
 }