public async Task <IActionResult> PutAsync([FromBody] Collector collector, CancellationToken token = default) { var(result, found) = await _collectorService.UpdateAsync(collector, token); if (!found) { return(NotFound()); } if (!result.IsValid) { return(BadRequest(result)); } return(Ok(collector)); }