コード例 #1
0
        public IActionResult Delete(string id)
        {
            var forecast = _weatherForecastService.Get(id);

            if (_weatherForecastService == null)
            {
                return(NotFound());
            }

            _weatherForecastService.Remove(forecast.Id);

            return(NoContent());
        }
コード例 #2
0
        private List <WeatherForecast> CleanData()
        {
            var weatherForecastList = _weatherForecastService.Get();

            if (weatherForecastList.Count > 0)
            {
                weatherForecastList.ForEach(item => _weatherForecastService.Remove(item));
            }
            return(weatherForecastList);
        }