示例#1
0
        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);
        }
示例#2
0
 public async Task <IEnumerable <WeatherForecastEntity> > Execute(ListAllWeatherForecastQuery query)
 {
     return(await _readOnlyRespository.Select().ToListAsync());
 }