public async Task <IEnumerable <WeatherForecast> > Execute() { var query = new ListAllWeatherForecastQuery(); var entities = await _queryDispatcher.Execute <ListAllWeatherForecastQuery, IEnumerable <WeatherForecastEntity> >(query); var result = new List <WeatherForecast>(entities.Count()); entities.ForEach(entity => result.Add(_mapper.Map <WeatherForecastEntity, WeatherForecast>(entity))); return(result); }
public async Task <IEnumerable <WeatherForecastEntity> > Execute(ListAllWeatherForecastQuery query) { return(await _readOnlyRespository.Select().ToListAsync()); }