public IList <ConferenceAlias> GetPublishedConferences()
        {
            var key    = "ConferenceDao_PublishedConferences";
            var cached = cache.Get(key) as IList <ConferenceAlias>;

            if (cached == null)
            {
                cached = decoratedDao.GetPublishedConferences();
                if (cached != null)
                {
                    cache.Set(key, cached, new CacheItemPolicy {
                        AbsoluteExpiration = DateTimeOffset.UtcNow.AddSeconds(10)
                    });
                }
            }

            return(cached);
        }
Пример #2
0
 public ActionResult Index()
 {
     return(View(dao.GetPublishedConferences()));
 }
Пример #3
0
 public async Task<IActionResult> GetPublishedConferences()
 {
     return Ok(await conferenceDao.GetPublishedConferences());
 }