private IActionResult ProcessWeathersList(WeathersList response) { if (response == null || response.List == null) { return(NotFound(JsonConvert.SerializeObject(response))); } if ("Success".Equals(response.MessageResponse)) { _apiService.Create(response); response.MessageResponse += $"weathers created in db from weathers returned from api"; return(Ok(JsonConvert.SerializeObject(response))); } else { return(BadRequest(JsonConvert.SerializeObject(response))); } }
public ActionResult <Weather> Store(Weather Weather) { var weather = _weatherService.Create(Weather); return(weather); }
public ActionResult <WeatherItem> Create([FromBody] WeatherItem weatherItem) { _weatherService.Create(weatherItem); return(CreatedAtRoute("GetWeatherItem", new { id = weatherItem.Id.ToString() }, weatherItem)); }