public ActionResult Display(string conferenceCode)
        {
            var conference = dao.GetConferenceDetails(conferenceCode);

            // Reply with 404 if not found?
            //if (conference == null)

            return(View(conference));
        }
Esempio n. 2
0
        public IActionResult GetConferenceDetails(string conferenceCode)
        {
            ConferenceDetails conferenceDetails = conferenceDao.GetConferenceDetails(conferenceCode);

            if (conferenceDetails == null)
            {
                return(NotFound($"Conference with code {conferenceCode} is not found"));
            }
            return(Ok(conferenceDetails));
        }
        public ConferenceDetails GetConferenceDetails(string conferenceCode)
        {
            var key        = "ConferenceDao_Details_" + conferenceCode;
            var conference = cache.Get(key) as ConferenceDetails;

            if (conference == null)
            {
                conference = decoratedDao.GetConferenceDetails(conferenceCode);
                if (conference != null)
                {
                    cache.Set(key, conference, new CacheItemPolicy {
                        AbsoluteExpiration = DateTimeOffset.UtcNow.AddMinutes(10)
                    });
                }
            }

            return(conference);
        }
Esempio n. 4
0
 public async Task<IActionResult> GetConferenceDetails(string conferenceCode)
 {
     return Ok(await conferenceDao.GetConferenceDetails(conferenceCode));
 }