public static ActivityDto CreateFromActivity(Activity fvActivity)
        {
            ActivityDto m = new ActivityDto();

            m.Id                = fvActivity.Id;
            m.Name              = fvActivity.Name;
            m.ActivityTypeId    = fvActivity.ActivityTypeId;
            m.DetailsDownloaded = true;
            m.Distance          = fvActivity.Distance.ToMiles();
            m.ElevationGain     = fvActivity.ElevationGain.ToFeet();
            m.Date              = fvActivity.StartDateLocal.ToShortDateString();
            m.MovingTime        = fvActivity.MovingTime.Value;
            m.Start             = fvActivity.Start;
            m.StartDateLocal    = fvActivity.StartDateLocal;
            m.SufferScore       = fvActivity.SufferScore.HasValue ? fvActivity.SufferScore.Value : 0;
            m.Calories          = fvActivity.Calories;
            m.HasMap            = fvActivity.StartLatitude != null ? true : false;
            m.IsRide            = fvActivity.ActivityType.IsRide;
            m.IsRun             = fvActivity.ActivityType.IsRun;
            m.IsSwim            = fvActivity.ActivityType.IsSwim;
            m.IsOther           = fvActivity.ActivityType.IsOther;

            m.HasPowerMeter = fvActivity.HasPowerMeter;
            m.TSS           = fvActivity.TSS.HasValue ? fvActivity.TSS.Value : 0;

            m.Athlete = AthleteDto.CreateFromAthlete(fvActivity.Athlete);
            m.Weight  = fvActivity.Weight;
            m.TSS     = fvActivity.TSS;

            return(m);
        }
        public static new ActivityDetailDto CreateFromActivity(Activity fvActivity)
        {
            LapDtoRepository  repo = new LapDtoRepository();
            ActivityDetailDto m    = Mapper.Map <ActivityDetailDto>(ActivityDto.CreateFromActivity(fvActivity));

            m.ActivityStream = ActivityStreams.CreateFromExistingActivityStream(fvActivity.Id);// uow.Activity.GetActivityStream(fvActivity.Id);

            m.Laps      = repo.GetLaps(fvActivity.Id);
            m.HeartRate = repo.GetLapStream(fvActivity.Id, PeakStreamType.HeartRate);
            m.Cadence   = repo.GetLapStream(fvActivity.Id, PeakStreamType.Cadence);

            ActivityMinMaxDto mma = new ActivityMinMaxDto(m.ActivityStream);

            mma.Populate();
            m.SummaryInfo = mma;

            m.Analytics = m.SummaryInfo.Analytics;

            ActivityZones zones = new ActivityZones(m);

            if (m.IsRun)
            {
                m.HeartRateZones = zones.GetZoneValues(ZoneType.RunHeartRate);
                m.RunPaceZones   = zones.GetZoneValues(ZoneType.RunPace);
                m.PaceByDistance = repo.GetBestEffort(fvActivity.Id);
            }
            else if (m.IsRide)
            {
                m.HeartRateZones = zones.GetZoneValues(ZoneType.BikeHeartRate);

                if (m.HasPowerMeter)
                {
                    m.Power      = repo.GetLapStream(fvActivity.Id, PeakStreamType.Power);
                    m.PowerZones = zones.GetZoneValues(ZoneType.BikePower);  // uow.Settings.GetZoneValues(m, ZoneType.BikePower);
                }
            }
            else if (m.IsSwim)
            {
            }


            return(m);
        }