Exemple #1
0
        public MatchDto GetMatchStatistics(int id)
        {
            var matchDto = new MatchDto();
            var match    = MatchesRepository.GetByWebApiId(id);

            if (match == null)
            {
                //https://api.steampowered.com/IDOTA2Match_570/GetMatchDetails/V1/?key=893F592E19918CA8A9CB5A847C94E2ED&match_id=46512132
                matchDto.WaitingTime = TaskRegistrator.RegisterMatchCommand(id);
                if (matchDto.WaitingTime == -1)
                {
                    return(null);
                }
                _unitOfWork.Commit();
                return(matchDto);
            }
            matchDto.Match       = CalculationService.GetMatchStatistics(match);
            matchDto.WaitingTime = 0;
            return(matchDto);
        }