public HttpResponseMessage PostWeather(Weather weather) { if (!ModelState.IsValid) { return Bad(ModelState); } var entityId = _service.AddWeather(weather); return Ok(entityId); }
public Weather AddWeather(Weather weather) { _weatherRepository.Create(weather); _weatherRepository.SaveChanges(); return weather; }