Beispiel #1
0
        public void RemoveWeatherDataByCity(string city)
        {
            var isCityInTable = new List <AvgDayForecast>();

            if (!string.IsNullOrEmpty(city))
            {
                isCityInTable = _weatherContext.AvgDayForecasts.Where(x => x.City.ToLower() == city.ToLower()).ToList();
            }

            if (isCityInTable != null)
            {
                _weatherContext.Remove(isCityInTable);
            }
        }