Beispiel #1
0
        public static IEnumerable <ClubMemberListItemVM> buildVM(IEnumerable <ClassLibrary1.memberList> listIN)
        {
            var vm = listIN.Select(m => new ClubMemberListItemVM
            {
                Name     = m.Name,
                Distance = RaceDetails.GetByRaceNameByMeters((double)m.Distance),
                Time     = RaceDetails.formatResult(m.Time),
                Id       = m.Id
            }

                                   ).AsEnumerable();

            return(vm);
        }
Beispiel #2
0
        public static List <RaceTimesVM> buildList(IEnumerable <race> listofraces, double targetdistance)
        {
            List <RaceTimesVM> list = new List <RaceTimesVM>();

            list = listofraces.Select(s => new RaceTimesVM
            {
                lastRaceId       = s.Id,
                lastRaceDistance = RaceDetails.GetByRaceNameByMeters(s.distance),
                lastRaceTime     = RaceDetails.formatResult(s.time),
                //predictedTime = RaceDetails.formatResult(Convert.ToInt32(RaceDetails.calcPredictedTime(s.distance, , s.time) + RaceDetails.cameron(s.distance, 8046.72, s.time)) / 2),
                //predictedRaw = (RaceDetails.calcPredictedTime(s.distance, 8046.72, s.time) + RaceDetails.cameron(s.distance, 8046.72, s.time)) / 2
                predictedTime = RaceDetails.formatResult(Convert.ToInt32(RaceDetails.calcPredictedTime(s.distance, targetdistance, s.time) + RaceDetails.cameron(s.distance, targetdistance, s.time)) / 2),
                predictedRaw  = (RaceDetails.calcPredictedTime(s.distance, targetdistance, s.time) + RaceDetails.cameron(s.distance, targetdistance, s.time)) / 2
            }

                                      ).ToList();

            return(list);
        }