private WeatherForecast MapToDomain(WeatherToApiDto weatherToApiDto) { return(new WeatherForecast() { CityName = weatherToApiDto.CityName, Country = weatherToApiDto.CountryName, Date = weatherToApiDto.Date, MaxTemp = weatherToApiDto.MaxTemp, MinTemp = weatherToApiDto.MinTemp }); }
public void Save(WeatherToApiDto weatherToApiDto) { var entity = MapToDomain(weatherToApiDto); weatherRepository.Save(entity); }
public async Task Send(WeatherToApiDto weatherToApiDto) { var jsonPost = new StringContent(JsonConvert.SerializeObject(weatherToApiDto), UnicodeEncoding.UTF8, "application/json"); await httpClient.PostAsync("api/v1/weather/", jsonPost).ConfigureAwait(false); }