public IActionResult Details(int id) { var listOfGuests = guestService.GetGuestsByEventId(id); var eventim = eventService.GetEventById(id); var eventdetails = new EventDetailsViewModel() { LocationId = eventim.LocationId, EventTypeId = eventim.EventTypeId, Name = eventim.Name, StartTime = eventim.StartTime, EndTime = eventim.EndTime, EstimatedBudget = eventim.EstimatedBudget, Description = eventim.Description, EventGuests = listOfGuests.Select(x => (GuestViewModel) new GuestViewModel().InjectFrom(x)).ToList() }; return(View(eventdetails)); }