public SoccerPlayer GetOlderTeamPlayer() { SoccerPlayer bestPlayer = _soccerPlayers.Values .OrderBy(player => player.BirtDate) .ThenBy(player => player.Id) .First(); return(bestPlayer); }
public SoccerPlayer GetHigherSalaryPlayer() { SoccerPlayer bestPlayer = _soccerPlayers.Values .OrderByDescending(player => player.Salary) .ThenBy(player => player.Id) .First(); return(bestPlayer); }
public SoccerPlayer GetBestPlayer() { SoccerPlayer bestPlayer = _soccerPlayers.Values .OrderByDescending(player => player.SkillLevel) .ThenBy(player => player.Id) .First(); return(bestPlayer); }
public SoccerPlayer GetTeamCaptain() { SoccerPlayer captain = _soccerPlayers.Values.FirstOrDefault(player => player.Capitan); if (captain is null) { throw new CaptainNotFoundException(); } else { return(captain); } }
public void AddPlayer(SoccerPlayer player) { _soccerPlayers.Add(player.Id, player); }