Exemple #1
0
        public ActionResult <EventVM> GetEventById(int id)
        {
            EventVM vm     = new EventVM();
            var     aEvent = eventDAO.GetEventByEventId(id);
            var     menu   = eventDAO.GetMenuByEventId(id);

            vm.Name        = aEvent.Name;
            vm.Description = aEvent.Description;
            vm.HostId      = aEvent.HostId;
            vm.Id          = id;
            foreach (EventMenuItem item in menu)
            {
                vm.Menu.Add(item);
            }
            return(vm);
        }