public ActionResult Index() { var result = WebCacheManager.FromCache("Events::List", () => { return(data.GetAllElements()); }); var model = Mapper.Map <IList <EventViewModel> >(result); return(View(model)); }
public ActionResult Details(string id) { var result = WebCacheManager.FromCache("Events::" + id, () => { return(data.GetElementById(id)); }); if (result == null) { return(RedirectToRoute("Error.NotFound")); } var model = Mapper.Map <Event, EventViewModel>(result); return(View(model)); }