public async Task <IActionResult> MonthlyDurationsAsync(string name) { var durations = await _store.GetMonthlyDurationsAsync(name); var response = new DurationsListResponseModel { Name = name, Durations = durations .Select(s => new DurationsResponseModel { Year = s.EventDate.Year, Month = s.EventDate.Month, AverageDuration = s.AverageGenericDuration }) .ToList() }; return(base.Ok(response)); }