Exemplo n.º 1
0
        private static MatchDataModel Create(WMTippApp.SvcFussballDB.Matchdata match)
        {
            var matchModelObj = new MatchDataModel();

            matchModelObj.MatchId        = match.matchID;
            matchModelObj.GroupId        = match.groupOrderID;
            matchModelObj.KickoffTime    = match.matchDateTime;
            matchModelObj.KickoffTimeUTC = match.matchDateTimeUTC;
            matchModelObj.HomeTeamId     = match.idTeam1;
            matchModelObj.AwayTeamId     = match.idTeam2;
            matchModelObj.HomeTeamScore  = match.pointsTeam1;
            matchModelObj.AwayTeamScore  = match.pointsTeam2;
            matchModelObj.HomeTeamIcon   = match.iconUrlTeam1;
            matchModelObj.AwayTeamIcon   = match.iconUrlTeam2;
            matchModelObj.HomeTeam       = match.nameTeam1;
            matchModelObj.AwayTeam       = match.nameTeam2;
            matchModelObj.IsFinished     = match.matchIsFinished;
            matchModelObj.LeagueShortcut = match.leagueShortcut;

            if (match.matchResults != null && match.matchResults.Any())
            {
                matchResult result = EvaluateResult(match.matchResults);

                matchModelObj.HasVerlaengerung = false;

                if (result != null)
                {
                    matchModelObj.HomeTeamScore = result.pointsTeam1;
                    matchModelObj.AwayTeamScore = result.pointsTeam2;
                }
            }

            return(matchModelObj);
        }
Exemplo n.º 2
0
        public MatchDataModel GetMatchData(int matchId)
        {
            string CACHE_MATCH_TAG = CACHE_MATCH_PREFIX + _leagueTag + matchId.ToString();

            WMTippApp.SvcFussballDB.Matchdata m = null;
            if (_cache.IsSet(CACHE_MATCH_TAG))
            {
                m = (WMTippApp.SvcFussballDB.Matchdata)_cache.Get(CACHE_MATCH_TAG);
                _cacheHits++;
            }
            else
            {
                m = _client.GetMatchByMatchID(matchId);
                _cache.Set(CACHE_MATCH_TAG, m, CACHE_DURATION);
                _remoteHits++;
            }

            return(Create(m));
        }
Exemplo n.º 3
0
        public MatchDataModel GetLastMatch()
        {
            string CACHE_LAST_MATCH_TAG = "cacheLastGame" + _leagueTag;
            string CACHE_MATCH_TAG      = CACHE_MATCH_PREFIX + _leagueTag;

            WMTippApp.SvcFussballDB.Matchdata m = null;
            if (_cache.IsSet(CACHE_LAST_MATCH_TAG))
            {
                m = (WMTippApp.SvcFussballDB.Matchdata)_cache.Get(CACHE_LAST_MATCH_TAG);
                _cacheHits++;
            }
            else
            {
                m = _client.GetLastMatch(_leagueTag);
                _cache.Set(CACHE_LAST_MATCH_TAG, m, CACHE_DURATION);
                _cache.Set(CACHE_MATCH_TAG + m.matchID.ToString(), m, CACHE_DURATION);
                _remoteHits++;
            }

            return(Create(m));
        }