public IActionResult Patch(PatchObject <WeatherForecast> patch) { var model = new WeatherForecast { Date = DateTime.Now, TemperatureC = 12, Summary = "summary", Ignored = "I was already here" }; patch.ApplyTo(model); var newModel = patch.CreateNewEntity(); return(Ok(new WeatherForecast[] { newModel, model })); }
public IEnumerable <WeatherForecast> Patch([FromBody] PatchObject <WeatherForecast> patch) { var model = new WeatherForecast { Date = DateTime.Now, TemperatureC = 12, Summary = "summary", Ignored = "I was already here" }; patch.ApplyTo(model); var newModel = patch.CreateNewEntity(); return(new WeatherForecast[] { newModel, model }); }