Exemple #1
0
        public async Task OnGetAsync()
        {
            UpcomingEvents = await _eventInfos.GetUpcomingEventsAsync();

            OnlineCourses = await _eventInfos.GetOnDemandEventsAsync();

            PastEvents = await _eventInfos.GetPastEventsAsync();

            OngoingEvents = await _eventInfos.GetOngoingEventsAsync();

            UnpublishedEvents = await _eventInfos.GetUnpublishedEventsAsync();
        }
        public async Task <ActionResult <IQueryable <OnlineCourseDto> > > Get()
        {
            var events = from e in await _eventInfoService.GetOnDemandEventsAsync()
                         select new OnlineCourseDto()
            {
                Id          = e.EventInfoId,
                Name        = e.Title,
                Slug        = e.Code,
                Description = e.Description,
                Featured    = e.Featured
            };

            return(Ok(events));
        }