示例#1
0
        public async Task <IEnumerable <ExpiringScreeningWrapper> > ExecuteAsync()
        {
            var now  = DateTime.UtcNow;
            var data = await _context.Set <EmployeeScreening>()
                       .Include(x => x.Employee)
                       .Include(x => x.Screening)
                       .Where(x => x.ExpirationDate <= now)
                       .Where(x => !x.NotificationIsInProgress || x.NotificationSentDate == null)
                       .Select(x => new ExpiringScreeningWrapper {
                EmployeeScreening = x
            })
                       .ToListAsync().ConfigureAwait(false);

            return(data);
        }