private void BuildTracks(XElement lapElement, Lap lap) { foreach (var trackElement in lapElement.Descendants(TrackName)) { var track = new Track { Lap = lap, }; BuildTrackpoints(trackElement, track); _tracks.Add(track); } }
private void BuildLaps(Activity activity) { foreach (var lapElement in _activityElement.Descendants(LapName)) { var lap = new Lap { Activity = activity, AverageHeartRateBpm = RoundIntValueOrDefault(lapElement, "AverageHeartRateBpm"), Calories = RoundIntValueOrDefault(lapElement, "Calories"), DistanceMeters = RoundIntValueOrDefault(lapElement, "DistanceMeters", MetersMultiplyBy), Intensity = GetValueOrDefault(lapElement, "Intensity"), MaximumHeartRateBpm = RoundIntValueOrDefault(lapElement, "MaximumHeartRateBpm"), MaximumSpeed = RoundIntValueOrDefault(lapElement, "MaximumSpeed", SpeedMultiplyBy), TotalTimeSeconds = RoundIntValueOrDefault(lapElement, "TotalTimeSeconds"), TriggerMethod = GetValueOrDefault(lapElement, "TriggerMethod"), }; BuildTracks(lapElement, lap); _laps.Add(lap); } }
partial void UpdateLap(Lap instance);
partial void DeleteLap(Lap instance);
partial void InsertLap(Lap instance);