예제 #1
0
        public async Task <IReadOnlyList <PlannerItemModel> > Execute()
        {
            var query = repository.GetAll()
                        .Where(item => item.CompletionDate == null && item.PlannedEndTime < dateTimeProvider.Now);

            return(await mapper.ProjectTo <PlannerItemModel>(query).ToListAsync());
        }
예제 #2
0
        public async Task <IReadOnlyList <PlannerItemModel> > Execute(DateTime?startDate, DateTime?endDate)
        {
            IQueryable <PlannerItem> itemQuery;

            if (startDate.HasValue && endDate.HasValue)
            {
                itemQuery = repository.GetAll().Where(item => item.PlannedActionDate.Date >= startDate.Value.Date && item.PlannedActionDate.Date <= endDate.Value.Date);
            }
            else if (startDate.HasValue)
            {
                itemQuery = repository.GetAll().Where(item => item.PlannedActionDate.Date == startDate.Value.Date);
            }
            else
            {
                itemQuery = repository.GetAll();
            }
            return(await mapper.ProjectTo <PlannerItemModel>(itemQuery).ToListAsync());
        }
예제 #3
0
        public async Task <IReadOnlyList <PlannerItemModel> > Execute()
        {
            var query = plannerItemRepository.GetAll().Where(p => p.CompletionDate.HasValue);

            return(await mapper.ProjectTo <PlannerItemModel>(query).ToListAsync());
        }