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) )); }
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); }
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 }); }
public Webhook(ILogger <Webhook> logger, SensorDataDbContext context, AirQualityMapper aqMapper, WeatherMapper wMapper) { _logger = logger; _context = context; _aqMapper = aqMapper; _wMapper = wMapper; }
public WeatherMapperTests() { _logger = Substitute.For <ILogger>(); _weatherMapper = new WeatherMapper(_logger); }