public IActionResult Delete(string id) { var forecast = _weatherForecastService.Get(id); if (_weatherForecastService == null) { return(NotFound()); } _weatherForecastService.Remove(forecast.Id); return(NoContent()); }
private List <WeatherForecast> CleanData() { var weatherForecastList = _weatherForecastService.Get(); if (weatherForecastList.Count > 0) { weatherForecastList.ForEach(item => _weatherForecastService.Remove(item)); } return(weatherForecastList); }