Ejemplo n.º 1
0
 public async Task <List <Conference> > Handle(GetExpiredUnclosedConferencesQuery query)
 {
     return(await _context.Conferences
            .Where(x => x.ScheduledDateTime.AddHours(14) <= DateTime.UtcNow &&
                   x.State < ConferenceState.Closed)
            .OrderBy(x => x.ScheduledDateTime)
            .AsNoTracking()
            .ToListAsync());
 }
        public async Task <IActionResult> GetExpiredOpenConferencesAsync()
        {
            _logger.LogDebug("GetExpiredOpenConferences");

            var query       = new GetExpiredUnclosedConferencesQuery();
            var conferences = await _queryHandler.Handle <GetExpiredUnclosedConferencesQuery, List <Conference> >(query);

            var response = conferences.Select(ConferenceToExpiredConferenceMapper.MapConferenceToExpiredResponse);

            return(Ok(response));
        }