Exemplo n.º 1
0
        public IList<Contest> RetrieveContests(IContestRepository repository)
        {
            //retrieve from cache
            IList<Contest> contests = ContestClient.RetrieveContests();
            if (contests == null)
            {
                //retrieve from database
                contests = repository.RetrieveContests();
                //save to cache
                ContestClient.SaveContests(contests);
            }

            return contests;
        }