public async Task Update(MatchFinishedEvent nextEvent) { 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); }
public async Task <IActionResult> GetMatches( int offset = 0, int pageSize = 100, GameMode gameMode = GameMode.Undefined, GateWay gateWay = GateWay.Undefined) { if (pageSize > 100) { pageSize = 100; } var matches = await _matchRepository.Load(gateWay, gameMode, offset, pageSize); var count = await _matchRepository.Count(gateWay, gameMode); return(Ok(new { matches, count })); }
public async Task <IActionResult> DatabaseHealthCheck() { var countOnGoingMatches = await _matchRepository.Count(); return(Ok(countOnGoingMatches)); }