private async Task <IList <AlertValue> > AlertValuesForAlertGroup(AlertGroup group) { var alertValues = new List <AlertValue>(); foreach (var alert in group.Alerts) { var values = await _alertValueService.AlertValuesForAlert(alert.Id); alertValues.AddRange(values); } return(alertValues.Where(av => !av.AlertGroupValueId.HasValue).OrderBy(e => e.TimespanStart).ToList()); }
public async Task <ActionResult <IEnumerable <AlertValueViewModel> > > GetAlertValue(int alertId) { try { var alertValues = await _alertValueService.AlertValuesForAlert(alertId); var transformed = new List <AlertValueViewModel>(); foreach (var alertValue in alertValues) { transformed.Add(await _alertValuePresenter.Present(alertValue)); } return(Ok(transformed)); } catch (Exception debug) { Console.WriteLine(debug); throw; } }