public async Task <IReadOnlyList <TaskItemModel> > GetAsync(TaskItemsFilterModel filter) { var persistenceFilter = _mapper.Map <TaskItemsFilter>(filter); var entities = await _taskItemRepository.FindAllByFilters(persistenceFilter); var taskGenerationMap = (await _taskGenerationRepository.GetAllAsync()) .ToDictionary(x => x.Id); return(entities .Select(x => MapTaskItemModel(x, taskGenerationMap)) .ToList()); }
public async Task <IReadOnlyList <TaskGenerationModel> > GetAllAsync() { var entities = await _taskGenerationRepository.GetAllAsync(); return(_mapper.Map <IReadOnlyList <TaskGenerationModel> >(entities)); }