private void AddLog(string logData, string zipCode) { JObject json = JObject.Parse(logData); var dto = new WeatherForecastEntity { Timestamp = DateTime.Now, ZipCode = zipCode, Temperature = (int)json["temperature"] }; _weatherForecastRepository.Add(dto); }
public async Task <IActionResult> CreateWeatherForecast([FromBody] WeatherForecast weatherForecast) { var result = await _weatherRepository.Add(weatherForecast); return(CreatedAtRoute(nameof(GetSingleWeatherForecast), new { weatherForecastID = result.Id }, result)); }
public void AddWeatherForecastModel(WeatherForecastModel weather) { repository.Add(new WeatherForecastEntity { Date = weather.Date, Summary = weather.Summary, TemperatureC = weather.TemperatureC }); }
public async Task Insert(WeatherForecast weatherForecast) { await _weatherForecastRepository.Add(weatherForecast); }