コード例 #1
0
 public Entities.CurrentWeather ToEntity(CurrentWeatherRequestDto request)
 {
     return(new Entities.CurrentWeather(
                default(long),
                request.CityName,
                CoordinatesMapper.ToEntity(request.Coordinates),
                request.Weather.Select(w => WeatherMapper.ToEntity(w)).ToList(),
                MainMapper.ToEntity(request.Main),
                WindMapper.ToEntity(request.Wind),
                CountryMapper.ToEntity(request.CountryInfo),
                RainMapper.ToEntity(request.Rain)
                ));
 }
コード例 #2
0
        public IComponent CreateComponent(IMessageHub hub, string fileName)
        {
            var file      = WeatherConfig.GetFileSystem();
            var logger    = WeatherConfig.GetLoggerConfiguration();
            var reader    = new WeatherReader(file, logger);
            var mapper    = new WeatherMapper(logger);
            var notify    = new WeatherNotifier(logger);
            var processor = new WeatherProcessor(reader, mapper, notify, hub, logger);

            _weatherComponent = new Types.WeatherComponent(reader, mapper, notify, processor, fileName);

            return(_weatherComponent);
        }
コード例 #3
0
 public CurrentWeatherRequestDto ToDto(Entities.CurrentWeather entity)
 {
     return(new CurrentWeatherRequestDto()
     {
         Main = MainMapper.ToDto(entity.Main),
         Weather = entity.Weather.Select(w => WeatherMapper.ToDto(w)).ToList(),
         Wind = WindMapper.ToDto(entity.Wind),
         Rain = RainMapper.ToDto(entity.Rain),
         Coordinates = CoordinatesMapper.ToDto(entity.Coordinates),
         CountryInfo = CountryMapper.ToDto(entity.CountryInfo),
         CityName = entity.CityName
     });
 }
コード例 #4
0
ファイル: Webhook.cs プロジェクト: Cisien/event-grid-webhook
 public Webhook(ILogger <Webhook> logger, SensorDataDbContext context, AirQualityMapper aqMapper, WeatherMapper wMapper)
 {
     _logger   = logger;
     _context  = context;
     _aqMapper = aqMapper;
     _wMapper  = wMapper;
 }
コード例 #5
0
 public WeatherMapperTests()
 {
     _logger        = Substitute.For <ILogger>();
     _weatherMapper = new WeatherMapper(_logger);
 }