public ActionResult Index(EventListingPage currentPage)
        {
            var model = new EventListingViewModel(currentPage)
            {
                AllEvents = _contentLocator.GetEventPages(currentPage.ContentLink)
            };

            return(View(model));
        }
示例#2
0
        /// <summary>
        /// Retuns a Event View model to be used directly
        /// </summary>
        /// <param name="id"></param>
        /// <returns>Event View Model</returns>
        public EventListingViewModel GetSingleEventListingViewModel(int id)
        {
            // Searches for the event
            EventBlock singleEvent = Db.Events.Find(id);

            // Converts the event to a View Model
            EventListingViewModel model = new EventListingViewModel
            {
                EventName = singleEvent.EventName,
                EventDate = singleEvent.EventDateAndTime
            };

            return(model);
        }