public async Task <List <GetExerciseHeartRateMsg> > GetExerciseHeartRateHistory(UsernameData hr) { List <GetExerciseHeartRateMsg> list = null; try { list = await _heartRateRecordDao.GetExerciseHeartRateHistory(hr); } catch (Exception e) { throw new CustomException("Error at get all resting heart rate data in service " + e); } return(list); }
public async Task <GetExerciseIntensityMsg> GetIntensities(UsernameData data) { List <GetExerciseHeartRateMsg> records = null; Biometric bio = null; try { records = await _heart.GetExerciseHeartRateHistory(data); bio = await _bio.GetMostRecentRecord(data); } catch (Exception e) { throw new CustomException("Error getting HR data in service" + e); } int age = CalculateAge(bio.dob); int resting = await GetRestingHeartRate(data); return(CalculateIntensities(records, age, resting)); }