//gets the details of an event using its id public ActionResult getDetailsofEvent(int id) { EventOperations eventOperation = new EventOperations(); var requiredEvent = eventOperation.getDetailsOfEvent(id); EventViewModel eventView = new EventViewModel() { Title = requiredEvent.Title, StartTime = requiredEvent.StartTime, TypeOfEvent = requiredEvent.TypeOfEvent, EventDate = requiredEvent.EventDate, DurationInHours = requiredEvent.DurationInHours, Description = requiredEvent.Description, OtherDetails = requiredEvent.OtherDetails, InviteByEmail = requiredEvent.InviteByEmail, commentViewModels = requiredEvent.Comments.Select(x => new CommentViewModel() { CreateDate = x.CreateDate, Comments = x.Comments, }), }; return(View(eventView)); }