Exemplo n.º 1
0
        public IActionResult ActivityDetails(int id)
        {
            //int id = Int32.Parse(Request.Query["id"]);

            var activity = _activityRepository.Get(id);
            var list     = _telemetryRepository.GetFirstAndLastTelemetry(id);

            TimeSpan time = list.Last().Instant.Subtract(list.First().Instant);

            var runner = _runnerRepository.Get(activity.IdRunner);

            var details = new ActivityDetailsViewModel
            {
                LatitudeStart  = list.First().Latitude,
                LongitudeStart = list.First().Longitude,
                FirstName      = runner.FirstName,
                LastName       = runner.LastName,
                Time           = time,
            };

            return(View(details));
        }