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 AllRamMetricsResponse() { Metrics = new List <RamMetricDto>() }; foreach (var metric in metrics) { response.Metrics.Add(_mapper.Map <RamMetricDto>(metric)); } return(Ok(response)); }