public async Task <IActionResult> Get([FromRoute] string panelId) { var panel = await _panelRepository.GetBySerialNumAsync(panelId); if (panel == null) { return(NotFound()); } var analytics = await _analyticsRepository.GetByPanelIdAsync(panelId); var result = new OneHourElectricityListModel { OneHourElectricitys = analytics.Select(c => new OneHourElectricityModel { Id = c.Id, KiloWatt = c.KiloWatt, DateTime = c.DateTime }).ToList() }; return(Ok(result)); }