Esempio n. 1
0
        public async Task AddTrackingRecord(UserRecordModel record)
        {
            float trend;
            float previousBMI = await _trackingRepository.GetPreviousBMI(record.UserFileId);

            if (previousBMI != 0)
            {
                trend = Math.Abs(previousBMI - record.BMI);
            }
            else
            {
                trend = 0;
            }

            record.Trend = trend;
            await _trackingRepository.Add(record);
        }