public IActionResult GetMetricsFromAgent([FromRoute] int agentId, [FromRoute] DateTimeOffset fromTime, [FromRoute] DateTimeOffset toTime) { _logger.LogDebug($"GetMetricsFromAgent : agentId = {agentId}; fromTime = {fromTime}; toTime = {toTime}"); var metrics = _repository.GetInTimePeriod(agentId, fromTime, toTime); var response = new AllHddMetricsResponse() { Metrics = new List <HddMetricDto>() }; foreach (var metric in metrics) { response.Metrics.Add(_mapper.Map <HddMetricDto>(metric)); } return(Ok(response)); }