Permalink
Browse files

Updated PlayerExtractor method GetCurrentClubName() - do not assume that

the current club is first in the list, use the leftDate to identify instead.
  • Loading branch information...
1 parent 0c2296a commit 4c50fe930a8a71497c7e3629d3352515ccb6e9c3 @MikeHook committed May 2, 2011
Showing with 739 additions and 6 deletions.
  1. +3 −6 CSharpApp/FootyLinks.Processes/PlayerExtractor.cs
  2. +736 −0 ErrorLog/importInfolog.txt
@@ -84,13 +84,10 @@ public string GetCurrentClubName()
if (_playerClubs.Any() == false)
return null;
- PlayerClubDto mostRecentClub = _playerClubs.First();
+ PlayerClubDto mostRecentClub = _playerClubs
+ .SingleOrDefault(c => c.PlayerLeftDate.HasValue == false);
- //There is a leaving date for their most recent club so they must be retired
- if (mostRecentClub.PlayerLeftDate != null)
- return null;
-
- return mostRecentClub.ClubName;
+ return mostRecentClub != null ? mostRecentClub.ClubName : null;
}
public IList<string> GetFormerClubs()
Oops, something went wrong.

0 comments on commit 4c50fe9

Please sign in to comment.