public async Task Update(MatchFinishedEvent nextEvent) { if (nextEvent.WasFakeEvent) { return; } var matchup = Matchup.Create(nextEvent); await _matchRepository.Insert(matchup); await _matchRepository.DeleteOnGoingMatch(matchup.MatchId); }
public async Task Update(MatchFinishedEvent nextEvent) { try { if (nextEvent.WasFakeEvent) { return; } var count = await _matchRepository.Count(); var matchup = Matchup.Create(nextEvent); matchup.Number = count + 1; await _matchRepository.Insert(matchup); await _matchRepository.DeleteOnGoingMatch(matchup.MatchId); } catch (Exception e) { Console.WriteLine(e); } }