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)));
            }
        }
示例#2
0
        public ActionResult <Weather> Store(Weather Weather)
        {
            var weather = _weatherService.Create(Weather);

            return(weather);
        }
示例#3
0
        public ActionResult <WeatherItem> Create([FromBody] WeatherItem weatherItem)
        {
            _weatherService.Create(weatherItem);

            return(CreatedAtRoute("GetWeatherItem", new { id = weatherItem.Id.ToString() }, weatherItem));
        }