Exemple #1
0
        public IActionResult Index()
        {
            var meetings = _meetingService.GetAllMeetingsAsync();

            var meetingVM = new MeetingViewModel
            {
                MeetingTypes = meetings.MeetingTypes.Select(mt => new MeetingTypeViewModel {
                    Id = mt.Id, Name = mt.Name
                }),
                Meetings = meetings.Meetings.Select(a => new MeetingViewModel
                {
                    Id       = a.Id,
                    Number   = a.Number,
                    DateTime = a.DateTime,
                    Type     = a.MeetingType.Name
                })
            };

            return(View(meetingVM));
        }