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