Ejemplo n.º 1
0
        public async Task <ActionResult <IEnumerable <EventInfoViewModel> > > GetRegistrations()
        {
            var eventinfos = await _eventInfoService.GetUpcomingEventsAsync();

            var vmlist = eventinfos.Select(m => new EventInfoViewModel(m));

            return(Ok(vmlist));
        }
Ejemplo n.º 2
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 <IActionResult> Get()
        {
            var events = await _eventsService.GetUpcomingEventsAsync();

            var list = events.Select(s => new
            {
                Id = s.EventInfoId,
                s.Title,
                s.Description,
                s.Location,
                s.City,
                s.DateStart,
                s.DateEnd,
                s.FeaturedImageUrl
            });

            return(Ok(list));
        }
        public async Task <ActionResult <IQueryable <EventDto> > > Get([FromQuery] EventInfoQueryParams query)
        {
            var events = from e in await _eventInfoService.GetUpcomingEventsAsync(query.ToEventInfoFilter())
                         select new EventDto()
            {
                Id          = e.EventInfoId,
                Name        = e.Title,
                Slug        = e.Code,
                Description = e.Description,
                StartDate   = e.DateStart,
                EndDate     = e.DateEnd,
                Featured    = e.Featured,
                Location    = new LocationDto()
                {
                    Name = e.Location
                }
            };

            return(Ok(events));
        }
Ejemplo n.º 5
0
        public async Task <ActionResult <IQueryable <EventDto> > > Get()
        {
            // TODO: add event type filter
            var events = from e in await _eventInfoService.GetUpcomingEventsAsync()
                         select new EventDto()
            {
                Id          = e.EventInfoId,
                Name        = e.Title,
                Slug        = e.Code,
                Description = e.Description,
                StartDate   = e.DateStart,
                EndDate     = e.DateEnd,
                Featured    = e.Featured,
                Location    = new LocationDto()
                {
                    Name = e.Location
                }
            };

            return(Ok(events));
        }