public void Update(bool isDrawn, int?winnerId) { GameResult gameResult; if (isDrawn) { gameResult = GameResult.Drawn; } else { gameResult = winnerId == CompetitorId ? GameResult.Won : GameResult.Lost; } _leaderboardService.Add(ContestId, CompetitorId, gameResult); }
public void Add(LeaderboardDto leaderboardDto) { var leaderboard = mapper.Map <Leaderboard>(leaderboardDto); leaderboardService.Add(leaderboard); }