public Tournament Get(int id)
        {
            return CacheManager.GetOrSet<Tournament>("tournament-" + id, () => {
                WebClient client = new WebClient();

                var response = client.Get<TournamentResponse>("tournaments/" + id + ".json");

                return response.Tournament;
            });
        }
        public Participant[] List(int tournamentId)
        {
            return CacheManager.GetOrSet<Participant[]>("participants-" + tournamentId, () => {

            WebClient client = new WebClient();
            var response = client.Get<ParticipantResponse[]>(string.Format("tournaments/{0}/participants.json", tournamentId));

            var query = from r in response
                        select r.Participant;

            return query.ToArray();
                                                        });
        }
        public Tournament[] List()
        {
            return CacheManager.GetOrSet<Tournament[]>("tournaments", () =>
                                                       {

            WebClient client = new WebClient();
            var response = client.Get<TournamentResponse[]>("tournaments.json");

            var query = from r in response
                select r.Tournament;

            return query.ToArray();
                                                       });
        }
Example #4
0
        public Match[] List(int tournamentId)
        {
            return CacheManager.GetOrSet<Match[]>("matches-" + tournamentId, () =>
                                           {
            var client = new WebClient();

            var response = client.Get<MatchResponse[]>(string.Format("tournaments/{0}/matches.json", tournamentId));

            var query = from r in response
                        select r.Match;

            return query.ToArray();
                                           });
        }