public List<SessionSummaryDto> GetIntervalSummary(IntervalSummaryRequestDto intervalSummaryRequestDto) { var session = GetSingle(intervalSummaryRequestDto.SessionId); var detectedIntervals = DetectIntervals(session); var workoutIntervals = detectedIntervals.Where(x => !x.IsRest).ToList(); var restIntervals = detectedIntervals.Where(x => x.IsRest).ToList(); var workoutSummary = CalculateWorkoutSummary(session, workoutIntervals, intervalSummaryRequestDto.Unit); var restSummary = CalculateWorkoutSummary(session, restIntervals, intervalSummaryRequestDto.Unit); var intervalSummaries = new List<SessionSummaryDto> { workoutSummary, restSummary }; return intervalSummaries; }
public HttpResponseMessage GetIntervalSummary(HttpRequestMessage request, IntervalSummaryRequestDto intervalSummaryRequestDto) { return CreateHttpResponse(request, () => { var intervalSummary = _sessionRepository.GetIntervalSummary(intervalSummaryRequestDto); HttpResponseMessage response = request.CreateResponse(HttpStatusCode.OK, intervalSummary); return response; }); }