コード例 #1
0
        public async Task <bool> InsertTraining(IFormFile file, string userName)
        {
            WorkoutDomain workoutDomain = GpxFileManager.DecodeGpxFile(file);

            workoutDomain.UserId = await _accountDataAccess.GetUserIdAsync(userName);

            _trainingDataAccess.InsertTraining(workoutDomain);

            return(true);
        }
コード例 #2
0
        public void ConfigureGpxTracksResolver(List <string> gpxTrackFiles, string trackSource, int toleranceInMeters, int toleranceInMinutes)
        {
            // Only setup if we have valid tracks
            if (gpxTrackFiles != null && gpxTrackFiles.Count != 0)
            {
                this.gpxTrackResolver = new GpsTrackResolver();
                this.gpxTrackResolver.ToleranceInMeters  = toleranceInMeters;
                this.gpxTrackResolver.ToleranceInMinutes = toleranceInMinutes;
                this.gpxTrackResolver.GpsTrackSource     = trackSource;

                foreach (string gpxTrackFile in gpxTrackFiles)
                {
                    this.gpxTrackResolver.Add(GpxFileManager.Read(gpxTrackFile));
                }
            }
        }