Ejemplo n.º 1
0
        public IActionResult Details(int id)
        {
            var eventFromId = eventService.GetEventById(id);

            if (eventFromId == null)
            {
                return(RedirectToAction("Error", "Home"));
            }

            var guestOfEvent = guestService.GetGuestsForAnEvent(eventFromId.Id).ToList();

            return(View(new EventGuestsModel()
            {
                EventModel = new EventModel().InjectFrom(eventFromId) as EventModel,
                Guests = guestOfEvent.Select(x => new GuestModel().InjectFrom(x) as GuestModel)
            }));
        }