//Returns all Public Events public ActionResult getAllPublicEvents() { EventOperations eventOperation = new EventOperations(); var allPublicEventsList = eventOperation.getAllPublicEvents().Select(eventDetails => new EventTitleViewModel() { Id = eventDetails.EventId, Title = eventDetails.Title, Date = eventDetails.EventDate, }).ToList(); var passedEvents = allPublicEventsList.Where(e => e.Date < DateTime.Now); var allupcomingEvents = allPublicEventsList.Where(e => e.Date >= DateTime.Now); return(View(new UpcomingPassedEventsModel() { PassedEvents = passedEvents, FutureEvents = allupcomingEvents } )); }