Exemplo n.º 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)
                ));
 }
Exemplo n.º 2
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
     });
 }