Ejemplo n.º 1
0
        private void UpdateBikes()
        {
            foreach (StravaDotNetGear.Bike b in stravaAthleteDetails.Bikes)
            {
                Gear g = Gear.CreateBike(b.Id, stravaAthleteDetails.Id);

                g.Brand       = b.Brand;
                g.Description = b.Description;
                g.Distance    = Convert.ToDecimal(b.Distance);
                switch (b.FrameType)
                {
                case StravaDotNetGear.BikeType.Cross: { g.FrameType = enums.BikeType.Cross; break; }

                case StravaDotNetGear.BikeType.Mountain: { g.FrameType = enums.BikeType.Mountain; break; }

                case StravaDotNetGear.BikeType.Road: { g.FrameType = enums.BikeType.Road; break; }

                case StravaDotNetGear.BikeType.Timetrial: { g.FrameType = enums.BikeType.Timetrial; break; }
                }
                g.IsPrimary     = b.IsPrimary;
                g.Model         = b.Model;
                g.Name          = b.Name;
                g.ResourceState = b.ResourceState;

                _unitOfWork.CRUDRepository.AddOrUpdate <Gear>(g);
            }
        }