public IActionResult Delete([FromBody] DateScope scope) { List <WeatherData> toDelete = _holder.TemperatureData.Where(i => i.Date >= scope.DateFrom && i.Date <= scope.DateTo).ToList(); foreach (var t in toDelete) { _holder.TemperatureData.Remove(t); } return(OK()); }
public IEnumerable <WeatherData> Get([FromBody] DateScope scope) { return(_holder.TemperatureData.Where(i => i.Date >= scope.DateFrom && i.Date <= scope.DateTo).ToArray()); }